ConversionUtility#

class ansys.stk.core.stkutil.ConversionUtility#

Object that contains a unit conversion utility.

Overview#

convert_quantity

Convert the specified quantity value from a given unit to another unit.

convert_date

Convert the specified date from a given unit to another unit.

convert_quantity_array

Convert the specified quantity values from a given unit to another unit.

convert_date_array

Convert the specified dates from a given unit to another unit.

new_quantity

Create an Quantity interface with the given dimension, unit and value.

new_date

Create an Date interface with the given unit and value.

new_position_on_earth

Create an IPosition interface with earth as its central body.

convert_position_array

Convert the specified position values from a given position type to another position type.

new_direction

Create an IDirection interface.

new_orientation

Create an IOrientation interface.

new_orbit_state_on_earth

Create an IOrbitState interface with earth as its central body.

new_position_on_cb

Create an IPosition interface using the supplied central body.

new_orbit_state_on_cb

Create an IOrbitState interface using the supplied central body.

query_direction_cosine_matrix

Return a Direction Cosine Matrix (DCM).

query_direction_cosine_matrix_array

Return a Direction Cosine Matrix (DCM) as an array.

new_cartesian3_vector

Create a cartesian vector.

new_cartesian3_vector_from_direction

Convert the direction to cartesian vector.

new_cartesian3_vector_from_position

Convert the position to cartesian vector.

Import detail#

from ansys.stk.core.stkutil import ConversionUtility

Method detail#

ConversionUtility.convert_quantity(self, dimension_name: str, from_unit: str, to_unit: str, from_value: float) float#

Convert the specified quantity value from a given unit to another unit.

Parameters:

dimension_name : str

from_unit : str

to_unit : str

from_value : float

Returns:

float

ConversionUtility.convert_date(self, from_unit: str, to_unit: str, from_value: str) str#

Convert the specified date from a given unit to another unit.

Parameters:

from_unit : str

to_unit : str

from_value : str

Returns:

str

ConversionUtility.convert_quantity_array(self, dimension_name: str, from_unit: str, to_unit: str, quantity_values: list) list#

Convert the specified quantity values from a given unit to another unit.

Parameters:

dimension_name : str

from_unit : str

to_unit : str

quantity_values : list

Returns:

list

ConversionUtility.convert_date_array(self, from_unit: str, to_unit: str, from_values: list) list#

Convert the specified dates from a given unit to another unit.

Parameters:

from_unit : str

to_unit : str

from_values : list

Returns:

list

ConversionUtility.new_quantity(self, dimension: str, unit_abbrv: str, value: float) Quantity#

Create an Quantity interface with the given dimension, unit and value.

Parameters:

dimension : str

unit_abbrv : str

value : float

Returns:

Quantity

ConversionUtility.new_date(self, unit_abbrv: str, value: str) Date#

Create an Date interface with the given unit and value.

Parameters:

unit_abbrv : str

value : str

Returns:

Date

ConversionUtility.new_position_on_earth(self) IPosition#

Create an IPosition interface with earth as its central body.

Returns:

IPosition

ConversionUtility.convert_position_array(self, position_type: PositionType, position_array: list, convert_to: PositionType) list#

Convert the specified position values from a given position type to another position type.

Parameters:

position_type : PositionType

position_array : list

convert_to : PositionType

Returns:

list

ConversionUtility.new_direction(self) IDirection#

Create an IDirection interface.

Returns:

IDirection

ConversionUtility.new_orientation(self) IOrientation#

Create an IOrientation interface.

Returns:

IOrientation

ConversionUtility.new_orbit_state_on_earth(self) IOrbitState#

Create an IOrbitState interface with earth as its central body.

Returns:

IOrbitState

ConversionUtility.new_position_on_cb(self, central_body_name: str) IPosition#

Create an IPosition interface using the supplied central body.

Parameters:

central_body_name : str

Returns:

IPosition

ConversionUtility.new_orbit_state_on_cb(self, central_body_name: str) IOrbitState#

Create an IOrbitState interface using the supplied central body.

Parameters:

central_body_name : str

Returns:

IOrbitState

ConversionUtility.query_direction_cosine_matrix(self, input_orientation: IOrientation) Tuple[ICartesian3Vector, ICartesian3Vector, ICartesian3Vector]#

Return a Direction Cosine Matrix (DCM).

Parameters:

input_orientation : IOrientation

Returns:

Tuple[ICartesian3Vector, ICartesian3Vector, ICartesian3Vector]

ConversionUtility.query_direction_cosine_matrix_array(self, input_orientation: IOrientation) list#

Return a Direction Cosine Matrix (DCM) as an array.

Parameters:

input_orientation : IOrientation

Returns:

list

ConversionUtility.new_cartesian3_vector(self) ICartesian3Vector#

Create a cartesian vector.

Returns:

ICartesian3Vector

ConversionUtility.new_cartesian3_vector_from_direction(self, input_direction: IDirection) ICartesian3Vector#

Convert the direction to cartesian vector.

Parameters:

input_direction : IDirection

Returns:

ICartesian3Vector

ConversionUtility.new_cartesian3_vector_from_position(self, input_position: IPosition) ICartesian3Vector#

Convert the position to cartesian vector.

Parameters:

input_position : IPosition

Returns:

ICartesian3Vector