CLASS v1.8.0

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.

Reference

PYTHON API

Constructor

method2 overloads
PolarCoordinate(angle: float, radius: float)

Overloaded function.

  1. PolarCoordinate()

Initialize a PolarCoordinate with zero angle and radius.

  1. PolarCoordinate(angle: float, radius: float)

Initialize a PolarCoordinate from explicit values.

Args

  • angle (float) — Angle in radians.
  • radius (float) — Distance from the origin.

angle

property
angle: float

The angle component in radians.

radius

property
radius: float

The radius component (distance from origin).

to_cartesian(self) -> Vec2

Convert this PolarCoordinate to a Vec2.

Returns

  • Vec2 — Cartesian representation of this coordinate.

Find your next step

Start typing to search the manual.