Table of Contents

Struct FixedBoundCircle

Namespace
FixedMathSharp.Geometry
Assembly
FixedMathSharp.dll

Represents a normalized two-dimensional circular bound.

[MemoryPackable(GenerateType.Object)]
public struct FixedBoundCircle : IEquatable<FixedBoundCircle>, IMemoryPackable<FixedBoundCircle>, IMemoryPackFormatterRegister
Implements
IMemoryPackable<FixedBoundCircle>
IMemoryPackFormatterRegister
Inherited Members

Remarks

Radius inputs are normalized by absolute value so a public circle cannot retain a negative radius through construction, assignment, or state load.

Constructors

FixedBoundCircle(BoundingCircleState)

Initializes a new instance from serialized or caller-provided state.

[JsonConstructor]
public FixedBoundCircle(FixedBoundCircle.BoundingCircleState state)

Parameters

state FixedBoundCircle.BoundingCircleState

FixedBoundCircle(Vector2d, Fixed64)

Initializes a new instance from a center point and radius.

public FixedBoundCircle(Vector2d center, Fixed64 radius)

Parameters

center Vector2d
radius Fixed64

Properties

Bounds

The normalized axis-aligned representable-domain intersection that contains every representable point of the circle.

[JsonIgnore]
[MemoryPackIgnore]
public FixedBoundArea Bounds { get; }

Property Value

FixedBoundArea

Center

The center point of the circle.

[JsonIgnore]
[MemoryPackIgnore]
public Vector2d Center { readonly get; set; }

Property Value

Vector2d

Radius

The non-negative radius of the circle. Assigned values are normalized by absolute value.

[JsonIgnore]
[MemoryPackIgnore]
public Fixed64 Radius { get; set; }

Property Value

Fixed64

State

Gets the current normalized state of the circle.

[JsonInclude]
[MemoryPackInclude]
public FixedBoundCircle.BoundingCircleState State { get; }

Property Value

FixedBoundCircle.BoundingCircleState

Methods

ClampPoint(Vector2d)

Clamps a point to this circle, returning the point unchanged when it is already inside.

public Vector2d ClampPoint(Vector2d point)

Parameters

point Vector2d

Returns

Vector2d

Contains(FixedBoundCircle)

Classifies another circle against this circle using boundary-inclusive overlap.

public FixedEnclosureType Contains(FixedBoundCircle circle)

Parameters

circle FixedBoundCircle

Returns

FixedEnclosureType

Contains(Vector2d)

Determines whether the point is inside this circle, including the boundary.

public bool Contains(Vector2d point)

Parameters

point Vector2d

Returns

bool

ContainsStrict(Vector2d)

Returns whether the point lies strictly inside this circle.

public bool ContainsStrict(Vector2d point)

Parameters

point Vector2d

Returns

bool

Remarks

Boundary points and every point tested against a zero-radius circle return false.

Deconstruct(out Vector2d, out Fixed64)

Deconstructs the circle into center and normalized radius.

public void Deconstruct(out Vector2d center, out Fixed64 radius)

Parameters

center Vector2d
radius Fixed64

Equals(FixedBoundCircle)

public bool Equals(FixedBoundCircle other)

Parameters

other FixedBoundCircle

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

Intersects(FixedBoundArea)

Determines whether an area intersects this circle, including boundary-only contact.

public bool Intersects(FixedBoundArea area)

Parameters

area FixedBoundArea

Returns

bool

Intersects(FixedBoundCircle)

Determines whether another circle intersects this circle, including boundary-only contact.

public bool Intersects(FixedBoundCircle circle)

Parameters

circle FixedBoundCircle

Returns

bool

IntersectsStrict(FixedBoundArea)

Determines whether an area overlaps this circle with positive area.

public bool IntersectsStrict(FixedBoundArea area)

Parameters

area FixedBoundArea

Returns

bool

IntersectsStrict(FixedBoundCircle)

Determines whether another circle overlaps this circle with positive area.

public bool IntersectsStrict(FixedBoundCircle circle)

Parameters

circle FixedBoundCircle

Returns

bool

ProjectPoint(Vector2d)

Projects a point onto the circle boundary. The center is returned when the direction is degenerate.

public Vector2d ProjectPoint(Vector2d point)

Parameters

point Vector2d

Returns

Vector2d

Operators

operator ==(FixedBoundCircle, FixedBoundCircle)

Determines whether two circles have the same normalized state.

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

Parameters

left FixedBoundCircle
right FixedBoundCircle

Returns

bool

operator !=(FixedBoundCircle, FixedBoundCircle)

Determines whether two circles have different normalized state.

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

Parameters

left FixedBoundCircle
right FixedBoundCircle

Returns

bool