NWH Common
Search Results for

    Show / Hide Table of Contents

    Class MathUtility

    Mathematical utility functions for common calculations.

    Inheritance
    object
    MathUtility
    Namespace: NWH.Common
    Assembly: NWH.Common.dll
    Syntax
    public static class MathUtility

    Methods

    | Edit this page View Source

    ClampWithRemainder(ref float, in float, out float)

    Clamps a value to a range and outputs how much it exceeded the range. Useful for clamping values while preserving overflow information.

    Declaration
    public static void ClampWithRemainder(ref float x, in float range, out float remainder)
    Parameters
    Type Name Description
    float x

    Value to clamp (will be modified).

    float range

    Range limit (value will be clamped to [-range, +range]).

    float remainder

    Amount by which x exceeded the range (output).

    • Edit this page
    • View Source
    In this article
    Back to top Copyright © NWH - Vehicle Physics, Aerodynamics, Dynamic Water Physics