Table of Contents

Struct Depth

Namespace
EncDotNet.S100.Quantities
Assembly
EncDotNet.S100.Core.dll

A depth: a vertical Length measured from a vertical datum, stored canonically in metres.

public readonly record struct Depth : IComparable<Depth>, IEquatable<Depth>
Implements
Inherited Members

Remarks

Depth is a specialization of Length for the core hydrographic concept of a sounding. It carries the same unit-independent, value-semantics design as Length and adds depth-specific conveniences (fathom-and-feet decomposition via TotalFathoms/TotalFeet). Positive values are below the datum; negative values (drying heights) are permitted and their sign is preserved.

A Depth converts implicitly to its underlying Length so it can participate in generic distance arithmetic, while remaining a distinct type at API boundaries where the hydrographic meaning matters (safety contour, safety depth, contour value).

Properties

TotalFathoms

The depth expressed in fathoms.

public double TotalFathoms { get; }

Property Value

double

TotalFeet

The depth expressed in international feet.

public double TotalFeet { get; }

Property Value

double

TotalMetres

The depth expressed in metres (the canonical unit).

public double TotalMetres { get; }

Property Value

double

Zero

A zero depth (at the datum). Equal to default(Depth).

public static Depth Zero { get; }

Property Value

Depth

Methods

Abs()

Returns the absolute (non-negative) magnitude of this depth.

public Depth Abs()

Returns

Depth

AsLength()

The underlying vertical Length.

public Length AsLength()

Returns

Length

CompareTo(Depth)

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

public int CompareTo(Depth other)

Parameters

other Depth

An object to compare with this instance.

Returns

int

A value that indicates the relative order of the objects being compared. The return value has these meanings:

Value Meaning
Less than zero This instance precedes other in the sort order.
Zero This instance occurs in the same position in the sort order as other.
Greater than zero This instance follows other in the sort order.

FromFathoms(double)

Creates a depth from a value in fathoms.

public static Depth FromFathoms(double fathoms)

Parameters

fathoms double

Returns

Depth

FromFeet(double)

Creates a depth from a value in international feet.

public static Depth FromFeet(double feet)

Parameters

feet double

Returns

Depth

FromLength(Length)

Creates a depth from an existing Length.

public static Depth FromLength(Length length)

Parameters

length Length

Returns

Depth

FromMetres(double)

Creates a depth from a value in metres.

public static Depth FromMetres(double metres)

Parameters

metres double

Returns

Depth

ToString()

Returns an invariant-culture string of the form "12.5 m" for diagnostic purposes. User-facing presentation should go through a dedicated formatter.

public override string ToString()

Returns

string

Operators

operator >(Depth, Depth)

Indicates whether one depth is deeper than another.

public static bool operator >(Depth a, Depth b)

Parameters

a Depth
b Depth

Returns

bool

operator >=(Depth, Depth)

Indicates whether one depth is deeper than or equal to another.

public static bool operator >=(Depth a, Depth b)

Parameters

a Depth
b Depth

Returns

bool

implicit operator Length(Depth)

Converts a depth to its underlying vertical Length.

public static implicit operator Length(Depth depth)

Parameters

depth Depth

Returns

Length

operator <(Depth, Depth)

Indicates whether one depth is shallower than another.

public static bool operator <(Depth a, Depth b)

Parameters

a Depth
b Depth

Returns

bool

operator <=(Depth, Depth)

Indicates whether one depth is shallower than or equal to another.

public static bool operator <=(Depth a, Depth b)

Parameters

a Depth
b Depth

Returns

bool