Angle

sealed class Angle : Comparable<Angle>

Represents an angle in either degrees or radians.

Inheritors

Types

Link copied to clipboard
object Companion
Link copied to clipboard
data class Degrees : Angle

Represents an angle in degrees.

Link copied to clipboard
data class Radians : Angle

Represents an angle in radians.

Properties

Link copied to clipboard
val cos: Double

Returns the cosine of the angle in radians.

Link copied to clipboard

Returns the angle's value in degrees.

Link copied to clipboard

Returns a normalized angle, ensuring the value is within [0, 360) degrees for degrees or [0, 2π) radians for radians.

Link copied to clipboard

Returns the angle's value in radians.

Link copied to clipboard
val sin: Double

Returns the sine of the angle in radians.

Link copied to clipboard
val tan: Double

Returns the tangent of the angle in radians.

Functions

Link copied to clipboard
open operator override fun compareTo(other: Angle): Int

Compares this angle with another angle.

Link copied to clipboard
operator fun div(divisor: Number): Angle

Divides this angle by a number, returning a new angle.

operator fun div(divisor: Angle): Double

Divides this angle by another angle, returning the ratio of their values.

Link copied to clipboard
operator fun minus(other: Angle): Angle

Subtracts another angle from this angle.

Link copied to clipboard
operator fun plus(other: Angle): Angle

Adds another angle to this angle.

Link copied to clipboard
operator fun rem(other: Angle): Angle

Calculates the remainder of this angle when divided by another angle.

Link copied to clipboard
operator fun times(factor: Number): Angle

Multiplies this angle by a factor.

Link copied to clipboard
open override fun toString(): String

Returns a string representation of the angle.

Link copied to clipboard
operator fun unaryMinus(): Angle

Returns the negation of this angle.