I need to calculate a 3D circle center point from 2 points(3D) and arc angle (plane normal is also known).
I searched it with Google but I think my English is not good enough to search properly. Anyone know the calculations to do this?
CodePudding user response:
We have points A, B
, normal N
, angle Fi
.
Calculate difference vector (arc chord) and middle point
AB = B - A
M = (A B) / 2
Calculate vector F
perpendicular to AB
and N
using vector product and normalize it
F = AB x N
uF = F / len(F)
We know that circle center C
lies on the ray from point M
with direction F
(with parameter t
equal to apothem CM
length (center-chord distance))
C = M t * uF
What should be t
value? We can express t
through right triangle AMC
parameters
tan(Fi/2) = 0.5*len(AB) / t
So finally center is
C = M uF * 0.5*len(AB) / tan(Fi/2)
Note that center C
is not unique because we don't know arc direction (just change sign before uF
in the last formula and get mirror point C'
against chord)