dotProductsToHalfAngleTrigValues MethodStatic

Return the half angle cosine, sine, and radians for the given vector dot products.

  • These values arise e.g. in the computation performed in Arc3d.toScaledMatrix3d.
  • Let vectors U and V define the ellipse x(t) = c + U cos(t) + V sin(t). We seek an angle t0 such that the 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 tan(2t0) = sin(2t0) / cos(2t0) = 2 U.V / (U.U - V.V), i.e., t0 can be computed given the input dot products. Math details can be found at docs/learning/geometry/Angle.md

dotProductsToHalfAngleTrigValues(dotUU: number, dotVV: number, dotUV: number, favorZero: booleantrue): TrigValues

@returns the angle t0 and its cosine and sine.

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 whether to allow a tight tolerance for returning t0 = 0 (default true).
When dotUV is near zero, U and V are nearly perpendicular, and the returned angle is near zero.

Returns - TrigValues

the angle t0 and its cosine and sine.

Defined in

Last Updated: 17 December, 2024