resolveRadiansToValidSweepFraction MethodStatic

Adjust a radians value to an angle sweep, extending beyond or clamping to [0,1] according to extendParam:

  • If radians is within the sweep, convert it to a fraction of the sweep.
  • If radians is outside the sweep and extendParam does not allow extension at both ends, adjust the fraction:
    • fraction below 0 if extendParam allows extension only at start
    • fraction above 1 if extendParam allows extension only at end
    • fraction clamped to [0,1] if extendParam disallows extension at both ends

resolveRadiansToValidSweepFraction(extendParam: VariantCurveExtendParameter, radians: number, sweep: AngleSweep): { fraction: number, isValid: boolean }

@returns adjusted fraction of sweep, and a boolean indicating whether it is valid, i.e. whether radians lies in the sweep extended per extendParam.

Parameter Type Description
extendParam VariantCurveExtendParameter  
radians number  
sweep AngleSweep  

Returns - { fraction: number, isValid: boolean }

adjusted fraction of sweep, and a boolean indicating whether it is valid, i.e. whether radians lies in the sweep extended per extendParam.

Defined in

Last Updated: 23 April, 2025