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.
線分の始点と終点を知っています。この例では、線分の距離が 5 であるとします。ここで、端点から 3 離れた点を知りたいと考えています。数学でこれを行う方法はありますか?
始点 (0,0) 終点 (0,5)
探したいポイント (0,2)
ポイントが(x1, y1)とであり、ポイント 2 から単位離れたポイントを(x2, y2)見つけたい場合:(x3, y3)n
(x1, y1)
(x2, y2)
(x3, y3)
n
d = sqrt((x2-x1)^2 + (y2 - y1)^2) #distance r = n / d #segment ratio x3 = r * x2 + (1 - r) * x1 #find point that divides the segment y3 = r * y2 + (1 - r) * y1 #into the ratio (1-r):r