PolarCoordinate
pykraken.PolarCoordinate PolarCoordinate models a polar coordinate pair.
More about PolarCoordinate
Attributes
- angle (
float) — Angle in radians. - radius (
float) — Distance from origin.
Methods
- to_cartesian — Convert the coordinate to a Vec2.
At a glance
4 membersReference
PYTHON APIPolarCoordinate(angle: float, radius: float)Overloaded function.
PolarCoordinate()
Initialize a PolarCoordinate with zero angle and radius.
PolarCoordinate(angle: float, radius: float)
Initialize a PolarCoordinate from explicit values.
Args
- angle (
float) — Angle in radians. - radius (
float) — Distance from the origin.
angle
propertyangle: floatThe angle component in radians.
radius
propertyradius: floatThe radius component (distance from origin).
to_cartesian
methodto_cartesian(self) -> Vec2Convert this PolarCoordinate to a Vec2.
Returns
- Vec2 — Cartesian representation of this coordinate.