/// <summary> /// Sets up the frame /// </summary> /// <param name="position"> Frame origin </param> /// <param name="velocity"> Velocity. Becomes frame tangent (normalised by constructor) </param> /// <param name="acceleration"> Acceleration. Used to calculate frame normal and binormal </param> public CurveFrame( Point3 position, Vector3 velocity, Vector3 acceleration ) { float sqrSpeed = velocity.SqrLength; float dotVA = velocity.Dot( acceleration ); Translation = position; XAxis = velocity.MakeNormal( ); YAxis = ( acceleration * sqrSpeed ) - ( velocity * dotVA ); ZAxis = Vector3.Cross( XAxis, YAxis ); m_Speed = Functions.Sqrt( sqrSpeed ); // NOTE: It's quite easy to calculate curvature here (because we've got first and second derivatives, and the square of speed, ready at hand). // I've removed the calculation because it does involve a length and a cross-product, which is a bit much if the caller isn't interested in the // curvature value (as is likely). Call Curve.EvaluateCurvature() instead. }