Table of Contents

Struct FixedPointAnchor2d

Namespace
FixedMathSharp.Geometry
Assembly
FixedMathSharp.dll

Identifies a conceptual 2D point by an origin, scalar rotation, and local point without requiring the transformed point to be representable.

public readonly struct FixedPointAnchor2d : IEquatable<FixedPointAnchor2d>
Implements
Inherited Members

Remarks

Relation-produced anchors can retain an exact sub-lattice feature term that is intentionally hidden behind the narrow comparison and materialization APIs. Anchors with identical rounded public local components can therefore remain distinct when they identify different exact features.

Constructors

FixedPointAnchor2d(Vector2d, Fixed64, Vector2d)

Creates a transformed point anchor.

public FixedPointAnchor2d(Vector2d origin, Fixed64 rotation, Vector2d localPoint)

Parameters

origin Vector2d
rotation Fixed64
localPoint Vector2d

FixedPointAnchor2d(Vector2d, Fixed64, Vector2d, Vector2d)

Creates a transformed point anchor from two additive local-space feature components.

public FixedPointAnchor2d(Vector2d origin, Fixed64 rotation, Vector2d localPoint, Vector2d localDisplacement)

Parameters

origin Vector2d
rotation Fixed64
localPoint Vector2d
localDisplacement Vector2d

Properties

LocalDisplacement

An additional local-space feature displacement that exact operations add to LocalPoint without a scalar intermediate.

public Vector2d LocalDisplacement { get; }

Property Value

Vector2d

LocalPoint

Gets the point in its supplied local frame.

public Vector2d LocalPoint { get; }

Property Value

Vector2d

Origin

Gets the point frame's world-space origin.

public Vector2d Origin { get; }

Property Value

Vector2d

Rotation

Gets the point frame's counterclockwise rotation in radians.

public Fixed64 Rotation { get; }

Property Value

Fixed64

Methods

CompareLocalFeature(in FixedPointAnchor2d)

Compares the complete local feature identity of this anchor with other in deterministic component order.

public int CompareLocalFeature(in FixedPointAnchor2d other)

Parameters

other FixedPointAnchor2d

Returns

int

Remarks

Frame origin and rotation are intentionally excluded. Exact sub-lattice centered-axis residuals are included after the public local components.

CompareSquaredDistance(in FixedPointAnchor2d, in FixedPointAnchor2d)

Compares the exact squared distance from this point to two other anchored points.

public int CompareSquaredDistance(in FixedPointAnchor2d first, in FixedPointAnchor2d second)

Parameters

first FixedPointAnchor2d
second FixedPointAnchor2d

Returns

int

A negative value when first is closer, zero when the distances are equal, or a positive value when second is closer.

Equals(FixedPointAnchor2d)

Returns whether both anchors have identical frames, rounded local components, and any retained exact feature identity.

public bool Equals(FixedPointAnchor2d other)

Parameters

other FixedPointAnchor2d

Returns

bool

Equals(object?)

Returns a hash code for the complete frame and exact feature identity.

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

GetLocalFeatureHash64()

Returns a stable 64-bit hash of the complete local feature identity.

public ulong GetLocalFeatureHash64()

Returns

ulong

TryGetLocalPointIn(Vector2d, Fixed64, out Vector2d)

Attempts to express this conceptual point in another rotated frame without materializing the world-space point.

public bool TryGetLocalPointIn(Vector2d frameOrigin, Fixed64 frameRotation, out Vector2d localPoint)

Parameters

frameOrigin Vector2d
frameRotation Fixed64
localPoint Vector2d

Returns

bool

TryGetOffsetFrom(in FixedPointAnchor2d, out Vector2d)

Attempts to obtain this point's exact offset from another transformed point without materializing either world-space point.

public bool TryGetOffsetFrom(in FixedPointAnchor2d other, out Vector2d offset)

Parameters

other FixedPointAnchor2d
offset Vector2d

Returns

bool

TryGetPoint(out Vector2d)

Attempts to materialize the conceptual world-space point with one final round-half-to-even conversion per component.

public bool TryGetPoint(out Vector2d point)

Parameters

point Vector2d

Returns

bool

TryReframe(Vector2d, Fixed64, out FixedPointAnchor2d)

Attempts to express this exact conceptual point in another rotated frame without discarding sub-lattice feature information.

public bool TryReframe(Vector2d frameOrigin, Fixed64 frameRotation, out FixedPointAnchor2d anchor)

Parameters

frameOrigin Vector2d
frameRotation Fixed64
anchor FixedPointAnchor2d

Returns

bool

Remarks

The operation fails when the target frame would require a general rational local coordinate that a compact point anchor cannot retain.

Operators

operator ==(FixedPointAnchor2d, FixedPointAnchor2d)

Returns whether two anchors have identical frame and local-point components.

public static bool operator ==(FixedPointAnchor2d left, FixedPointAnchor2d right)

Parameters

left FixedPointAnchor2d
right FixedPointAnchor2d

Returns

bool

operator !=(FixedPointAnchor2d, FixedPointAnchor2d)

Returns whether two anchors differ in any frame or local-point component.

public static bool operator !=(FixedPointAnchor2d left, FixedPointAnchor2d right)

Parameters

left FixedPointAnchor2d
right FixedPointAnchor2d

Returns

bool