fractionOfProjectionToVectorXYXY MethodStatic

Return fractional length of the projection of the first vector ("the space vector") ux,uy to the vector vx,vy ("the direction vector")

fractionOfProjectionToVectorXYXY(ux: number, uy: number, vx: number, vy: number, defaultFraction: number = 0): number

@returns the signed length of the projection divided by the length of the direction vector

Parameter Type Description
ux number x component of space vector
uy number y component of space vector
vx number x component of direction vector
vy number y component of direction vector
defaultFraction number the returned value in case the magnitude of the direction vector is too small

Returns - number

the signed length of the projection divided by the length of the direction vector

Defined in

Last Updated: 19 March, 2026