dotProductsToHalfAngleTrigValues MethodStatic
Return the half angle cosine, sine, and radians for given dot products between vectors. The vectors define an ellipse using x(t) = c + U cos(t) + V sin(t) so U and V are at angle t=0 degree and t=90 degree. The half angle t0 is an angle such that x(t0) is one of the ellipse semi-axis.
- This construction arises e.g. in
Arc3d.toScaledMatrix3d
. - Given ellipse x(t) = c + U cos(t) + V sin(t), find t0 such that radial vector W(t0) = x(t0) - c is perpendicular to the ellipse.
- Then 0 = W(t0).x'(t0) = (U cos(t0) + V sin(t0)).(V cos(t0) - U sin(t0)) = U.V cos(2t0) + 0.5 (V.V - U.U) sin(2t0) implies sin(2t0) / cos(2t0) = 2 U.V / (U.U - V.V), i.e., t0 can be computed given the three dot products on the RHS. math details can be found at docs/learning/geometry/Angle.md
dotProductsToHalfAngleTrigValues(dotUU: number, dotVV: number, dotUV: number, favorZero: boolean = true): TrigValues
Parameter | Type | Description |
---|---|---|
dotUU | number | dot product of vectorU with itself |
dotVV | number | dot product of vectorV with itself |
dotUV | number | dot product of vectorU with vectorV |
favorZero | boolean |
Returns - TrigValues
Defined in
- geometry3d/Angle.ts Line 461
Last Updated: 30 November, 2023