Polar

data class Polar(theta: Double, radius: Double) : LinearType<Polar>

A 2D point defined in the Polar coordinate system.

Parameters

theta

The angle in degrees.

Constructors

Polar
Link copied to clipboard
fun Polar(theta: Double, radius: Double = 1.0)

Types

Companion
Link copied to clipboard
object Companion

Functions

div
Link copied to clipboard
open operator override fun div(scale: Double): Polar
makeSafe
Link copied to clipboard
fun makeSafe(): Polar

make a safe version by bringing theta between 0 and 360

minus
Link copied to clipboard
open operator override fun minus(right: Polar): Polar
plus
Link copied to clipboard
open operator override fun plus(right: Polar): Polar
times
Link copied to clipboard
open operator override fun times(scale: Double): Polar
operator fun times(scale: Polar): Polar

Properties

cartesian
Link copied to clipboard
val cartesian: Vector2

Constructs equivalent Cartesian coordinates from the polar representation.

radius
Link copied to clipboard
val radius: Double = 1.0
theta
Link copied to clipboard
val theta: Double