Skip to main content

Torque

Inherits from: object A class to represent 3D torque. Represents torque in 3D space with x, y, and z components. Supports mathematical operations and conversions to/from various formats. Attributes: x (float): x-component of torque (N⋅m) y (float): y-component of torque (N⋅m) z (float): z-component of torque (N⋅m)

init

Torque.__init__(x: float, y: float, z: float) -> None
Initialize a Torque object.
Arguments
x (float)
float
required
x-component of torque in Newton-meters
y (float)
float
required
y-component of torque in Newton-meters
z (float)
float
required
z-component of torque in Newton-meters
Returns
returns
None

to_dict

Torque.to_dict() -> dict
Serialize to dictionary for JSON transfer.
Returns
dict
dict
Dictionary representation of the torque

from_dict

Torque.from_dict(data: dict) -> 'Torque'
Deserialize from dictionary.
Arguments
data (dict)
dict
required
Dictionary containing torque data
Returns
Torque
'Torque'
Reconstructed torque object