Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
434 views
in Technique[技术] by (71.8m points)

math - Formula for calculating third point from two points and angle

first angle enter image description here enter image description here

I am trying to find angle of yellow line from center of circle. I know circle radius, red and blue point coordinates and angle between red and yellow lines.

What kind of formula should I use?

question from:https://stackoverflow.com/questions/65905285/formula-for-calculating-third-point-from-two-points-and-angle

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Think the situation is as follows:

fig1

Points R and B are given, as well as angle θ. What is asked for is angle φ.

I place a coordinate system on the center of the circle and expressed R in polar coordinates

d = sqrt( (x_R-x_B)^2 + (y_R-y_B)^2 )
ψ = atan2( (y_R-y_B), (x_R-x_B) )

Then use the law of cosines to find l

l = sqrt(r^2 + d^2 -2*r*d*cos(θ))

Now to find φ and ψ we use the following two equations

d*cos(ψ) = r*cos(φ)-l*cos(θ-φ)
d*sin(ψ) = r*sin(φ)+l*sin(θ-φ)

This is where I am stuck now.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...