CurveTangent Enumeration
Microsoft Silverlight will reach end of support after October 2021. Learn more.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Math (in Microsoft.Xna.Framework.Math.dll)
Syntax
'Declaration
Public Enumeration CurveTangent
public enum CurveTangent
Members
Member name | Description | |
---|---|---|
Flat | A Flat tangent always has a value equal to zero. | |
Linear | A Linear tangent at a CurveKey is equal to the difference between its Value and the value of the preceding or succeeding CurveKey. | |
Smooth | A Smooth tangent smooths the inflection between a TangentIn and TangentOut by taking into account the values of both neighbors of the CurveKey. |
Remarks
A Linear tangent at a CurveKey is equal to the difference between its Value and the value of the preceding or succeeding CurveKey.
For example, in CurveMyCurve, where i is greater than zero and (i + 1) is less than the total number of CurveKey instances in MyCurve, the linear TangentIn of MyCurve.Keys[i] is equal to:
( MyCurve.Keys[i].Value - MyCurve.Keys[i - 1].Value )
Similarly, the linear TangentOut is equal to:
( MyCurve.Keys[i + 1].Value - MyCurve.Keys[i].Value.)
A Smooth tangent smooths the inflection between a TangentIn and TangentOut by taking into account the values of both neighbors of the CurveKey.
The smooth TangentIn of MyCurve.Keys[i] is equal to:
( ( MyCurve.Keys[i + 1].Value - MyCurve.Keys[i - 1].Value ) *
( ( MyCurve.Keys[i].Position - MyCurve.Keys[i - 1].Position ) /
( MyCurve.Keys[i + 1].Position - MyCurve.Keys[i-1].Position ) ) )
Similarly, the smooth TangentOut is equal to:
( ( MyCurve.Keys[i + 1].Value - MyCurve.Keys[i - 1].Value ) *
( ( MyCurve.Keys[i + 1].Position - MyCurve.Keys[i].Position ) /
( MyCurve.Keys[i + 1].Position - MyCurve.Keys[i - 1].Position ) ) )
Version Information
Silverlight
Supported in: 5
Platforms
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.