API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

classPolarVector

@codexo/exojs / math / stable

A 2D vector expressed in polar coordinates: `radius` (magnitude) and `phi` (angle in radians, measured from the positive X-axis).

2
props
2
methods
0
events
Import
import { PolarVector } from '@codexo/exojs'

A 2D vector expressed in polar coordinates: `radius` (magnitude) and `phi` (angle in radians, measured from the positive X-axis).

Constructors1
new(radius: number, angle: number): PolarVector
Methods2
Create a PolarVector from a Cartesian vector, preserving both magnitude and direction. The roundtrip PolarVector.fromVector(v).toVector() reproduces v (modulo float precision).
Properties2
phi: number
Angle in radians, measured from the positive X-axis.
radius: number
Source