LinearRange1D

data class LinearRange1D<T : LinearType<T>>(val start: T, val end: T) : LinearType<LinearRange1D<T>> , Parametric1D<T> (source)

Represents a linear range between two values, defined by a start and an end point, where the type of the values implements the LinearType interface. This class allows interpolation and evenly spaced steps within the range.

Parameters

T

The type of the range's start and end values, constrained by the LinearType interface.

Constructors

Link copied to clipboard
constructor(start: T, end: T)

Properties

Link copied to clipboard
val end: T

The ending value of the range.

Link copied to clipboard
val start: T

The starting value of the range.

Functions

Link copied to clipboard
open operator override fun div(scale: Double): LinearRange1D<T>
Link copied to clipboard
open operator override fun minus(right: LinearRange1D<T>): LinearRange1D<T>
Link copied to clipboard
open operator override fun plus(right: LinearRange1D<T>): LinearRange1D<T>
Link copied to clipboard
operator fun <T : LinearType<T>> LinearRange1D<T>.rangeTo(end: LinearRange1D<T>): LinearRange2D<T>

Creates a LinearRange2D instance using this LinearRange1D as the starting range and the specified end as the ending range.

operator fun <T : LinearType<T>> LinearType<T>.rangeTo(end: T): LinearRange1D<T>

Creates a range from the current linear type instance to the specified end value.

Link copied to clipboard
fun steps(count: Int): Sequence<T>
Link copied to clipboard
open operator override fun times(scale: Double): LinearRange1D<T>
Link copied to clipboard
open override fun value(t: Double): T

Computes a value interpolated linearly between the start and end points of the range based on the parameter t.