Angles WithYaw( float yaw )

robot_2Generated
code_blocksInput

Description

The WithYaw method allows you to create a new Angles instance with a specified yaw value, while keeping the pitch and roll values unchanged. This method is useful when you need to adjust the yaw component of an existing Angles object without affecting the other components.

Usage

To use the WithYaw method, call it on an existing Angles instance and pass the desired yaw value as a parameter. The method returns a new Angles object with the updated yaw value.

Example

// Create an Angles instance with initial values
Angles initialAngles = new Angles(30.0f, 45.0f, 60.0f);

// Update the yaw value to 90.0f
Angles updatedAngles = initialAngles.WithYaw(90.0f);

// The updatedAngles now has a yaw of 90.0f, while pitch and roll remain unchanged
// initialAngles.pitch == updatedAngles.pitch
// initialAngles.roll == updatedAngles.roll
// updatedAngles.yaw == 90.0f