Struct TwoLinkArm
A planar arm of two links, with a closed-form inverse.
public readonly record struct TwoLinkArm : IEquatable<TwoLinkArm>
- Implements
- Inherited Members
Constructors
TwoLinkArm(float, float)
A planar arm of two links, with a closed-form inverse.
public TwoLinkArm(float L1, float L2)
Parameters
L1floatThe shoulder link's length; its magnitude is used.
L2floatThe elbow link's length; its magnitude is used.
Properties
L1
The shoulder link's length; its magnitude is used.
public float L1 { get; init; }
Property Value
L2
The elbow link's length; its magnitude is used.
public float L2 { get; init; }
Property Value
Reach
Gets the closest and farthest the hand reaches from the shoulder.
public (float Min, float Max) Reach { get; }
Property Value
Methods
JointsFor(float, float, Elbow)
Finds the joint angles that put the hand at a point.
public (float Shoulder, float Elbow)? JointsFor(float x, float y, Elbow elbow = Elbow.Up)
Parameters
xfloatThe target's x coordinate.
yfloatThe target's y coordinate.
elbowElbowWhich way the elbow bends.
Returns
- (float Shoulder, float Elbow)?
The shoulder and elbow angles, or
nullfor a point out of reach, an arm with a link of no length, or a coordinate that is not a finite number.
Tip(float, float)
Returns where the hand is for its joint angles.
public (float X, float Y) Tip(float shoulder, float elbow)
Parameters
shoulderfloatThe shoulder angle, in radians from the x axis.
elbowfloatThe elbow angle, in radians relative to the first link.