Ray

interface Ray : Transformable

Represents a transformable ray in a two-dimensional Euclidean space.

Implementations that use default-implemented members of this interface must make sure that the properties origin, direction and the copy method are independent of other members and the computational complexity of these members is trivial.

Inheritors

Properties

Link copied to clipboard
abstract val direction: Vector2F

Returns the direction of this ray.

Link copied to clipboard
open override val orientation: ComplexF

Returns the orientation of this object in reference to the origin of ComplexF.ONE.

Link copied to clipboard
abstract val origin: Vector2F

Returns the origin of this ray.

Link copied to clipboard
open override val position: Vector2F

Returns the position of this object in reference to the origin of Vector2F.ZERO.

Functions

Link copied to clipboard
open fun closestPointTo(point: Vector2F): Vector2F

Returns the closest point on this ray to the given point.

Link copied to clipboard
open operator fun component1(): Vector2F

Returns the origin of this ray.

Link copied to clipboard
open operator fun component2(): Vector2F

Returns the direction of this ray.

Link copied to clipboard
open operator fun contains(point: Vector2F): Boolean

Returns true if this ray approximately contains the given point.

Link copied to clipboard
abstract fun copy(origin: Vector2F = this.origin, direction: Vector2F = this.direction): Ray

Returns a copy of this instance with specified properties changed.

Link copied to clipboard
open override fun dilatedBy(point: Vector2F, factor: Float): Ray

Returns a copy of this object that is dilated around the point by a factor.

Link copied to clipboard
open fun interpolated(to: Ray, by: Float): Ray

Returns a copy of this ray interpolated to other ray by a factor.

Link copied to clipboard
open fun intersects(annulus: Annulus): Boolean

Returns true if this ray intersects the given annulus.

open fun intersects(circle: Circle): Boolean

Returns true if this ray intersects the given circle.

open fun intersects(lineSegment: LineSegment): Boolean

Returns true if this ray intersects the given lineSegment.

open fun intersects(ray: Ray): Boolean

Returns true if this ray intersects the given ray.

open fun intersects(rectangle: Rectangle): Boolean
open fun intersects(rectangle: RoundedRectangle): Boolean

Returns true if this ray intersects the given rectangle.

open fun intersects(polygon: RegularPolygon): Boolean

Returns true if this ray intersects the given polygon.

open fun intersects(triangle: RegularTriangle): Boolean
open fun intersects(triangle: Triangle): Boolean

Returns true if this ray intersects the given triangle.

open fun intersects(square: Square): Boolean

Returns true if this ray intersects the given square.

Link copied to clipboard
open override fun movedBy(displacement: Vector2F): Ray

Returns a copy of this object that is moved by a displacement.

Link copied to clipboard
open override fun movedTo(position: Vector2F): Ray

Returns a copy of this object that is moved to the position.

Link copied to clipboard
open override fun rotatedAroundPointBy(point: Vector2F, rotation: AngleF): Ray
open override fun rotatedAroundPointBy(point: Vector2F, rotation: ComplexF): Ray

Returns a copy of this object that is rotated around the point by a rotation.

Link copied to clipboard
open override fun rotatedAroundPointTo(point: Vector2F, orientation: AngleF): Ray
open override fun rotatedAroundPointTo(point: Vector2F, orientation: ComplexF): Ray

Returns a copy of this object that is rotated around the point to the orientation.

Link copied to clipboard
open override fun rotatedBy(rotation: AngleF): Ray
open override fun rotatedBy(rotation: ComplexF): Ray

Returns a copy of this object that is rotated by a rotation.

Link copied to clipboard
open override fun rotatedTo(orientation: AngleF): Ray
open override fun rotatedTo(orientation: ComplexF): Ray

Returns a copy of this object that is rotated to the orientation.

Link copied to clipboard
open override fun scaledBy(factor: Float): Ray

Returns a copy of this object that is scaled by a factor.

Link copied to clipboard
open override fun transformedBy(displacement: Vector2F, rotation: AngleF): Ray
open override fun transformedBy(displacement: Vector2F, rotation: ComplexF): Ray

Returns a copy of this object that is moved by a displacement and rotated by a rotation.

open override fun transformedBy(displacement: Vector2F, rotation: AngleF, scaleFactor: Float): Ray
open override fun transformedBy(displacement: Vector2F, rotation: ComplexF, scaleFactor: Float): Ray

Returns a copy of this object that is moved by a displacement, rotated by a rotation, and scaled by a scaleFactor.

Link copied to clipboard
open override fun transformedTo(position: Vector2F, orientation: AngleF): Ray
open override fun transformedTo(position: Vector2F, orientation: ComplexF): Ray

Returns a copy of this object that is moved to the position and rotated to the orientation.