Package yams.gearing

Class Sprocket

java.lang.Object
yams.gearing.Sprocket

public class Sprocket extends Object
Sprocket class to handle calculating the conversion factor of a sprocket in your mechanism.
  • 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

      public Sprocket(String[] reductionStage)
      Construct the Sprocket with the reduction stages given.
      Parameters:
      reductionStage - List of stages in the format of "IN:OUT".
  • Method Details

    • fromStages

      public static Sprocket fromStages(String... stages)
      Construct the Sprocket with the reduction stages given.
      Parameters:
      stages - List of stages in the format of "IN:OUT".
      Returns:
      Sprocket representation
    • times

      public Sprocket times(double x)
      Multiply the sprocket reduction ratio by X.
      Parameters:
      x - X to multiply by.
      Returns:
      Sprocket for chaining.
    • div

      public Sprocket div(double x)
      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