Package yams.gearing
Class Sprocket
java.lang.Object
yams.gearing.Sprocket
Sprocket class to handle calculating the conversion factor of a sprocket in your mechanism.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondiv(double x) Divide the sprocket reduction ratio by X.static SprocketfromStages(String... stages) Construct theSprocketwith the reduction stages given.doubleGet the conversion factor to transform the sprocket input into the sprocket output rotations.doubleGet the conversion factor to transform the sprocket output value into the sprocket input value.times(double x) Multiply the sprocket reduction ratio by X.
-
Constructor Details
-
Sprocket
public Sprocket(double[] sprocketReductionStage) Create the sprocket given the teeth of each sprocket in the chain.- Parameters:
sprocketReductionStage- Sprocket teeth, in the form of "IN:OUT" => IN/OUT
-
Sprocket
Construct theSprocketwith the reduction stages given.- Parameters:
reductionStage- List of stages in the format of "IN:OUT".
-
-
Method Details
-
fromStages
Construct theSprocketwith the reduction stages given.- Parameters:
stages- List of stages in the format of "IN:OUT".- Returns:
- Sprocket representation
-
times
Multiply the sprocket reduction ratio by X.- Parameters:
x- X to multiply by.- Returns:
Sprocketfor chaining.
-
div
Divide the sprocket reduction ratio by X.- Parameters:
x- X to divide by.- Returns:
Sprocket
-
getInputToOutputConversionFactor
public double getInputToOutputConversionFactor()Get the conversion factor to transform the sprocket input into the sprocket output rotations.- Returns:
- OUT/IN or OUT:IN
-
getOutputToInputConversionFactor
public double getOutputToInputConversionFactor()Get the conversion factor to transform the sprocket output value into the sprocket input value.- Returns:
- IN:OUT or IN/OUT
-