Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私は学校のプログラミング プロジェクトに取り組んでおり、特定のポイントをパーセンテージで知る必要があります。例えば:
ポイント 1 = 10,5 ポイント 2 = 16,8
ここで、2 つのポイントと距離のパーセンテージから新しいポイントを計算する必要があります。たとえば、距離は 25% です。
私はすでにインターネットで多くの検索を行いましたが、これをどのように計算する必要があるのか 理解できません。
距離がそれらの間の距離の 25% であり、新しいポイントがその間にある場合:
これを使用できます:
point1=x1,y1 & point2=x2,y2 & new_point=xn,yn & ratio=r
それから:
xn=(1-r) x1+r x2
yn=(1-r) y1+r y2