Accuracy#

class ansys.geometry.core.misc.accuracy.Accuracy#

Decimal precision evaluations for math operations.

Overview#

length_accuracy

Return the LENGTH_ACCURACY constant.

angle_accuracy

Return the ANGLE_ACCURACY constant.

double_accuracy

Return the DOUBLE_ACCURACY constant.

length_is_equal

Check if the comparison length is equal to the reference length.

equal_doubles

Compare two double values.

compare_with_tolerance

Compare two doubles given the relative and absolute tolerances.

length_is_greater_than_or_equal

Check if the length is greater than the reference length.

length_is_less_than_or_equal

Check if the length is less than or equal to the reference length.

length_is_zero

Check if the length is within the length accuracy of exact zero.

length_is_negative

Check if the length is below a negative length accuracy.

length_is_positive

Check if the length is above a positive length accuracy.

angle_is_zero

Check if the length is within the angle accuracy of exact zero.

angle_is_negative

Check if the angle is below a negative angle accuracy.

angle_is_positive

Check if the angle is above a positive angle accuracy.

is_within_tolerance

Check if two values are inside a relative and absolute tolerance.

Import detail#

from ansys.geometry.core.misc.accuracy import Accuracy

Method detail#

static Accuracy.length_accuracy() ansys.geometry.core.typing.Real#

Return the LENGTH_ACCURACY constant.

static Accuracy.angle_accuracy() ansys.geometry.core.typing.Real#

Return the ANGLE_ACCURACY constant.

static Accuracy.double_accuracy() ansys.geometry.core.typing.Real#

Return the DOUBLE_ACCURACY constant.

static Accuracy.length_is_equal(comparison_length: ansys.geometry.core.typing.Real, reference_length: ansys.geometry.core.typing.Real) bool#

Check if the comparison length is equal to the reference length.

Returns:
bool

True if the comparison length is equal to the reference length within the length accuracy, False otherwise.

Notes

The check is done up to the constant value specified for LENGTH_ACCURACY.

static Accuracy.equal_doubles(a: ansys.geometry.core.typing.Real, b: ansys.geometry.core.typing.Real)#

Compare two double values.

static Accuracy.compare_with_tolerance(a: ansys.geometry.core.typing.Real, b: ansys.geometry.core.typing.Real, relative_tolerance: ansys.geometry.core.typing.Real, absolute_tolerance: ansys.geometry.core.typing.Real) ansys.geometry.core.typing.Real#

Compare two doubles given the relative and absolute tolerances.

static Accuracy.length_is_greater_than_or_equal(comparison_length: ansys.geometry.core.typing.Real, reference_length: ansys.geometry.core.typing.Real) bool#

Check if the length is greater than the reference length.

Returns:
bool

True if the comparison length is greater than the reference length within the length accuracy, False otherwise.

Notes

The check is done up to the constant value specified for LENGTH_ACCURACY.

static Accuracy.length_is_less_than_or_equal(comparison_length: ansys.geometry.core.typing.Real, reference_length: ansys.geometry.core.typing.Real) bool#

Check if the length is less than or equal to the reference length.

Returns:
bool

True if the comparison length is less than or equal to the reference length within the length accuracy, False otherwise.

Notes

The check is done up to the constant value specified for LENGTH_ACCURACY.

static Accuracy.length_is_zero(length: ansys.geometry.core.typing.Real) bool#

Check if the length is within the length accuracy of exact zero.

Returns:
bool

True if the length is within the length accuracy of exact zero, False otherwise.

static Accuracy.length_is_negative(length: ansys.geometry.core.typing.Real) bool#

Check if the length is below a negative length accuracy.

Returns:
bool
True if the length is below a negative length accuracy,

False otherwise.

static Accuracy.length_is_positive(length: ansys.geometry.core.typing.Real) bool#

Check if the length is above a positive length accuracy.

Returns:
bool
True if the length is above a positive length accuracy,

False otherwise.

static Accuracy.angle_is_zero(angle: ansys.geometry.core.typing.Real) bool#

Check if the length is within the angle accuracy of exact zero.

Returns:
bool
True if the length is within the angle accuracy of exact zero,

False otherwise.

static Accuracy.angle_is_negative(angle: ansys.geometry.core.typing.Real) bool#

Check if the angle is below a negative angle accuracy.

Returns:
bool
True if the angle is below a negative angle accuracy,

False otherwise.

static Accuracy.angle_is_positive(angle: ansys.geometry.core.typing.Real) bool#

Check if the angle is above a positive angle accuracy.

Returns:
bool
True if the angle is above a positive angle accuracy,

False otherwise.

static Accuracy.is_within_tolerance(a: ansys.geometry.core.typing.Real, b: ansys.geometry.core.typing.Real, relative_tolerance: ansys.geometry.core.typing.Real, absolute_tolerance: ansys.geometry.core.typing.Real) bool#

Check if two values are inside a relative and absolute tolerance.

Parameters:
aReal

First value.

bReal

Second value.

relative_toleranceReal

Relative tolerance accepted.

absolute_toleranceReal

Absolute tolerance accepted.

Returns:
bool

True if the values are inside the accepted tolerances, False otherwise.