Table of Contents

Struct Vec3Hfr

Namespace
Hi.Geom.Topo
Assembly
HiDisp.dll

3D vector with Fraction<decimal> elements. Provides unlimited-precision exact arithmetic for geometric computations. Corresponds to C++ vec3<wfr_t>.

public struct Vec3Hfr : IEquatable<Vec3Hfr>
Implements
Inherited Members
Extension Methods

Constructors

Vec3Hfr(Fraction<decimal>, Fraction<decimal>, Fraction<decimal>)

Initializes a new Vec3Hfr with three fraction components.

public Vec3Hfr(Fraction<decimal> x, Fraction<decimal> y, Fraction<decimal> z)

Parameters

x Fraction<decimal>
y Fraction<decimal>
z Fraction<decimal>

Vec3Hfr(Vec3d, decimal)

Initializes a new Vec3Hfr from a Vec3d with the specified resolution. Converts each double component to a fraction via Stern-Brocot approximation.

public Vec3Hfr(Vec3d src, decimal resolution)

Parameters

src Vec3d

Source double-precision vector.

resolution decimal

Fraction approximation tolerance.

Fields

X

X component.

public Fraction<decimal> X

Field Value

Fraction<decimal>

Y

Y component.

public Fraction<decimal> Y

Field Value

Fraction<decimal>

Z

Z component.

public Fraction<decimal> Z

Field Value

Fraction<decimal>

Methods

Dot(Vec3Hfr)

Dot product.

public readonly Fraction<decimal> Dot(Vec3Hfr b)

Parameters

b Vec3Hfr

Returns

Fraction<decimal>

Equals(Vec3Hfr)

Indicates whether the current object is equal to another object of the same type.

public readonly bool Equals(Vec3Hfr other)

Parameters

other Vec3Hfr

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object)

Indicates whether this instance and a specified object are equal.

public override readonly bool Equals(object obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

Evaluate()

Evaluates all components.

public Vec3Hfr Evaluate()

Returns

Vec3Hfr

GetCross(Vec3Hfr)

Cross product: this x b. Corresponds to C++ get_cross.

public readonly Vec3Hfr GetCross(Vec3Hfr b)

Parameters

b Vec3Hfr

Returns

Vec3Hfr

GetHashCode()

Returns the hash code for this instance.

public override readonly int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

Pack()

Packs (reduces) all components to irreducible form.

public Vec3Hfr Pack()

Returns

Vec3Hfr

ToString()

Returns the fully qualified type name of this instance.

public override readonly string ToString()

Returns

string

The fully qualified type name.

ToVec3d()

Converts to a Vec3d by evaluating each fraction component.

public readonly Vec3d ToVec3d()

Returns

Vec3d

Operators

operator +(Vec3Hfr, Vec3Hfr)

Addition.

public static Vec3Hfr operator +(Vec3Hfr a, Vec3Hfr b)

Parameters

a Vec3Hfr
b Vec3Hfr

Returns

Vec3Hfr

operator ==(Vec3Hfr, Vec3Hfr)

Equality operator.

public static bool operator ==(Vec3Hfr a, Vec3Hfr b)

Parameters

a Vec3Hfr
b Vec3Hfr

Returns

bool

operator !=(Vec3Hfr, Vec3Hfr)

Inequality operator.

public static bool operator !=(Vec3Hfr a, Vec3Hfr b)

Parameters

a Vec3Hfr
b Vec3Hfr

Returns

bool

operator *(Fraction<decimal>, Vec3Hfr)

Scalar multiplication.

public static Vec3Hfr operator *(Fraction<decimal> s, Vec3Hfr a)

Parameters

s Fraction<decimal>
a Vec3Hfr

Returns

Vec3Hfr

operator *(Vec3Hfr, Fraction<decimal>)

Scalar multiplication.

public static Vec3Hfr operator *(Vec3Hfr a, Fraction<decimal> s)

Parameters

a Vec3Hfr
s Fraction<decimal>

Returns

Vec3Hfr

operator -(Vec3Hfr, Vec3Hfr)

Subtraction.

public static Vec3Hfr operator -(Vec3Hfr a, Vec3Hfr b)

Parameters

a Vec3Hfr
b Vec3Hfr

Returns

Vec3Hfr

operator -(Vec3Hfr)

Negation.

public static Vec3Hfr operator -(Vec3Hfr a)

Parameters

a Vec3Hfr

Returns

Vec3Hfr