[StructLayout(LayoutKind.Sequential, Pack = 8, Size = 48)] [DebuggerDisplay("Pt({m_P.X},{m_P.Y},{m_P.Z}) Dir({m_V.X},{m_V.Y},{m_V.Z})")] [Serializable] public struct Ray3d : ISerializable, IEquatable<Ray3d>, IEpsilonComparable<Ray3d>
Represents an immutable ray in three dimensions, using position and direction.

Constructors

Ray3d

#Since v5.0
public Ray3d(Point3d position, Vector3d direction)
Initializes a new Ray3d instance.
position (Point3d)The position.
direction (Vector3d)The direction.

Properties

Direction

#Since v5.0
public Vector3d Direction { get; }
Gets the direction vector of this ray.

Position

#Since v5.0
public Point3d Position { get; }
Gets the starting position of this ray.

Methods

EpsilonEquals

#Since v5.4
[ConstOperation] public bool EpsilonEquals(Ray3d other, double epsilon)
Check that all values in other are within epsilon of the values in this
other (Ray3d)
epsilon (double)
EpsilonEquals

Equals

#
[ConstOperation] public override bool Equals(object obj)
Determines whether the specified System.Object is a Ray3d and has the same values as the present ray.
obj (object)The specified object.
true if obj is a Ray3d and has the same position and direction as this; otherwise false.
ValueType.Equals

Equals

#Since v5.0
[ConstOperation] public bool Equals(Ray3d ray)
Determines whether the specified Ray3d has the same value as the present ray.
ray (Ray3d)The specified ray.
true if ray has the same position and direction as this; otherwise false.

GetHashCode

#
[ConstOperation] public override int GetHashCode()
Computes a hashing number that represents the current ray.
A signed integer that represents both position and direction, but is not unique.

PointAt

#Since v5.0
[ConstOperation] public Point3d PointAt(double t)
Evaluates a point along the ray.
t (double)The t parameter.
A point at (Direction*t + Position).
Explicit

ISerializable.GetObjectData

#
[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)] void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
info (SerializationInfo)
context (StreamingContext)

Operators

OperationResultDescription
Ray3d==Ray3dboolDetermines whether two Ray3d have equal values.
Ray3d!=Ray3dboolDetermines whether two Ray3d have different values.