• Articles
  • Api Documentation
Show / Hide Table of Contents
  • Paramdigma.Core
    • Convert
    • Intersect3D
    • Intersect3D.LineLineIntersectionResult
    • Intersect3D.LineLineIntersectionStatus
    • Intersect3D.LinePlaneIntersectionStatus
    • Intersect3D.RayFacePerimeterIntersectionStatus
    • Settings
  • Paramdigma.Core.Collections
    • Interval
    • Matrix<T>
  • Paramdigma.Core.Curves
    • Geodesics
    • LevelSets
  • Paramdigma.Core.Exceptions
    • UnsetGeometryException
  • Paramdigma.Core.Extensions
    • Lists
  • Paramdigma.Core.Geometry
    • BaseCurve
    • BasePoint
    • Box
    • Circle
    • Cylinder
    • Delaunay
    • InvalidCurveException
    • Line
    • Line2d
    • Mesh
    • MeshCorner
    • MeshEdge
    • MeshFace
    • MeshGeometry
    • MeshHalfEdge
    • MeshPoint
    • MeshTopology
    • MeshVertex
    • NurbsCurve
    • NurbsSurface
    • Plane
    • Point2d
    • Point3d
    • Point4d
    • Polyline
    • Polyline2d
    • Ray
    • Ray2d
    • Rectangle2d
    • Sphere
    • Torus
    • Vector2d
    • Vector3d
    • VectorNd
  • Paramdigma.Core.Geometry.Interfaces
    • ICurve
    • ISurface
    • IVector
  • Paramdigma.Core.IO
    • CsvReader
    • CsvWritter
    • OBJMeshData
    • ObjReader
    • ObjWritter
    • OffMeshData
    • OffReader
    • OffResult
    • OffWriter
  • Paramdigma.Core.LinearAlgebra
    • Complex
    • LeastSquaresLinearFit
    • Triplet
    • TripletData
  • Paramdigma.Core.Optimization
    • GradientDescent
    • GradientDescent.FitnessFunction
    • GradientDescentOptions
    • GradientDescentResult
    • KMeansCluster
    • KMeansClustering
    • KMeansClustering.IterationCompletedEventArgs
  • Paramdigma.Core.Spatial
    • DelaunayEdge
    • DelaunayPoint
    • DelaunayTriangle
    • Octree
    • PointCloud
    • PointCloudMember
    • QuadTree

Struct Interval

Represents an range between two numbers.

Namespace: Paramdigma.Core.Collections
Assembly: Paramdigma.Core.dll
Syntax
public struct Interval

Constructors

| Improve this Doc View Source

Interval(Interval)

Initializes a new instance of the Interval struct from another interval.

Declaration
public Interval(Interval interval)
Parameters
Type Name Description
Interval interval

Interval to duplicate.

| Improve this Doc View Source

Interval(Double, Double)

Initializes a new instance of the Interval struct from a start and end value.

Declaration
public Interval(double start, double end)
Parameters
Type Name Description
System.Double start

Starting value of the interval.

System.Double end

Ending value of the interval.

Properties

| Improve this Doc View Source

End

Gets or sets the ending value of the interval.

Declaration
public double End { get; set; }
Property Value
Type Description
System.Double

Value will always be the biggest unless interval is inverted.

| Improve this Doc View Source

HasInvertedDirection

Gets a value indicating whether an interval has it's direciton inverted (Start > End).

Declaration
public bool HasInvertedDirection { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

Length

Gets the space between the start and end of the interval.

Declaration
public double Length { get; }
Property Value
Type Description
System.Double
| Improve this Doc View Source

Start

Gets or sets the starting value of the interval.

Declaration
public double Start { get; set; }
Property Value
Type Description
System.Double

Value will always be lower unless interval is inverted.

| Improve this Doc View Source

Unit

Gets a new unit interval.

Declaration
public static Interval Unit { get; }
Property Value
Type Description
Interval

New interval from 0.0 to 1.0.

Methods

| Improve this Doc View Source

Contains(Double)

Check if a number is contained inside this interval.

Declaration
public bool Contains(double number)
Parameters
Type Name Description
System.Double number

Number to check containment.

Returns
Type Description
System.Boolean

True if number is contained.

| Improve this Doc View Source

Crop(Double)

Crop a number so that it is contained inside this interval.

Declaration
public double Crop(double number)
Parameters
Type Name Description
System.Double number

Number to crop.

Returns
Type Description
System.Double

Cropped number.

| Improve this Doc View Source

CropNumber(Double, Interval)

Crop a number so that it's contained on the given interval.

Declaration
public static double CropNumber(double number, Interval interval)
Parameters
Type Name Description
System.Double number

Number to crop.

Interval interval

Interval to crop number with.

Returns
Type Description
System.Double

Cropped number value.

| Improve this Doc View Source

FlipDirection()

Swap the Start and End values of this interval.

Declaration
public void FlipDirection()
| Improve this Doc View Source

Remap(Double, Interval)

Remap a number from this interval to a given one.

Declaration
public double Remap(double number, Interval toInterval)
Parameters
Type Name Description
System.Double number

Number to remap.

Interval toInterval

Interval to remap number to.

Returns
Type Description
System.Double

Remapped number inside given interval.

| Improve this Doc View Source

RemapFromUnit(Double)

Remap a number from a unit interval to this interval.

Declaration
public double RemapFromUnit(double number)
Parameters
Type Name Description
System.Double number

Number to remap.

Returns
Type Description
System.Double

Remapped number.

| Improve this Doc View Source

RemapNumber(Double, Interval, Interval)

Remap a number from one interval to another.

Declaration
public static double RemapNumber(double number, Interval fromInterval, Interval toInterval)
Parameters
Type Name Description
System.Double number

Number to remap.

Interval fromInterval

Origin interval.

Interval toInterval

Destination interval.

Returns
Type Description
System.Double

Remapped number.

| Improve this Doc View Source

RemapToUnit(Double)

Remap a number from this interval to a unit interval.

Declaration
public double RemapToUnit(double number)
Parameters
Type Name Description
System.Double number

Number to remap.

Returns
Type Description
System.Double

Value remaped from 0 to 1.

  • Improve this Doc
  • View Source
Back to top Generated by DocFX