openrndr / org.openrndr.math / Polar

Polar

data class Polar : LinearType<Polar> (source)

Polar coordinate Ref: https://en.wikipedia.org/wiki/Polar_coordinate_system theta angle in degrees

Constructors

<init>

Polar coordinate Ref: https://en.wikipedia.org/wiki/Polar_coordinate_system theta angle in degrees

Polar(theta: Double, radius: Double = 1.0)

Properties

cartesian

Construct a Cartesian coordinate from polar representation

val cartesian: Vector2

radius

val radius: Double

theta

val theta: Double

Functions

div

operator fun div(s: Double): Polar

makeSafe

make a safe version by bringing theta between 0 and 360

fun makeSafe(): Polar

minus

operator fun minus(s: Polar): Polar

plus

operator fun plus(s: Polar): Polar

times

operator fun times(s: Polar): Polar
operator fun times(s: Double): Polar

Companion Object Functions

fromVector

Construct a polar coordinate representation for Cartesian vector 2

fun fromVector(vector: Vector2): Polar