Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "math/polar"

Index

Variables

Variables

Const polar2

polar2: TaggedFn1<"vec2", "vec2"> = defn("vec2", "polar2", ["vec2"], (v) => [ret(vec2(length(v), atan(div($y(v), $x(v))))),])

Converts 2D cartesian vector v to polar coordinates, i.e. [r,θ] (angle in radians). See cartesian2 for reverse operation.

param

-

Const polar3

polar3: TaggedFn1<"vec3", "vec3"> = defn("vec3", "polar3", ["vec3"], (v) => {let r: FloatSym;return [(r = sym(length(v))),ret(vec3(r, asin(div($z(v), r)), atan(div($y(v), $x(v))))),];})

Converts 3D cartesian vector v to spherical coordinates, i.e. [r,θ,ϕ] (angles in radians). See cartesian3 for reverse operation.

param

-

Generated using TypeDoc