|
Stepdance Software Library
|
KinematicsPolarToCartesian converts polar coordinates (radius and angle) to Cartesian coordinates (X and Y). More...
#include <kinematics.hpp>
Public Member Functions | |
| void | begin (float64_t fixed_radius=0) |
| Initializes the KinematicsPolarToCartesian with an optional fixed radius. If a fixed radius is provided, the radius input BlockPort will be ignored. | |
Public Attributes | |
| BlockPort | input_radius |
| Input BlockPort for radius (r) in polar coordinates. Ignored if a fixed radius is set in begin(). Map upstream components to this port. | |
| BlockPort | input_angle |
| Input BlockPort for angle (theta) in polar coordinates. Map upstream components to this port. | |
| BlockPort | output_x |
| Output BlockPort for X axis motion. Map downstream components to this port. | |
| BlockPort | output_y |
| Output BlockPort for Y axis motion. Map downstream components to this port. | |
Protected Member Functions | |
| void | run () |
KinematicsPolarToCartesian converts polar coordinates (radius and angle) to Cartesian coordinates (X and Y).
The KinematicsPolarToCartesian class transforms polar coordinate inputs into Cartesian X and Y outputs. This is useful for simulating a system with a polar mechanism like a pottery wheel or a lathe. Heres an example of how to instantiate and configure a KinematicsPolarToCartesian component and then use it to drive Cartesian motion from polar inputs:
| void KinematicsPolarToCartesian::begin | ( | float64_t | fixed_radius = 0 | ) |
Initializes the KinematicsPolarToCartesian with an optional fixed radius. If a fixed radius is provided, the radius input BlockPort will be ignored.
| fixed_radius | Optional fixed radius value. Default is 0. |