Table of Contents

Struct TwoLinkArm

Namespace
Pamoja.Kit
Assembly
Pamoja.Kit.dll

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

L1 float

The shoulder link's length; its magnitude is used.

L2 float

The 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

float

L2

The elbow link's length; its magnitude is used.

public float L2 { get; init; }

Property Value

float

Reach

Gets the closest and farthest the hand reaches from the shoulder.

public (float Min, float Max) Reach { get; }

Property Value

(float Min, float Max)

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

x float

The target's x coordinate.

y float

The target's y coordinate.

elbow Elbow

Which way the elbow bends.

Returns

(float Shoulder, float Elbow)?

The shoulder and elbow angles, or null for 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

shoulder float

The shoulder angle, in radians from the x axis.

elbow float

The elbow angle, in radians relative to the first link.

Returns

(float Min, float Max)

The hand's position.