Resend my activation email : Register : Log in 
BCF: Bike Chat Forums


Sprocket Calculator

Reply to topic
Bike Chat Forums Index -> General Bike Chat
View previous topic : View next topic  
Author Message

lihp
World Chat Champion



Joined: 22 Sep 2010
Karma :

PostPosted: 20:27 - 21 Nov 2010    Post subject: Sprocket Calculator Reply with quote

Was bored so wrote a quick Java Application to calculate new top speed with different sprockets. You'll need to know your front and rear sprocket sizes currently, and what you plan to go to, as well as relevant top speed for which ever gear you are calculating.

Code:

// Sprocket calculator

class Sprockets
{
        public static void main (String[] args)
        {

        // Check correct syntax at runtime
        if (args.length != 5)
                {
                System.out.println("Syntax: java Sprockets OrigRear OrigFront NewRear NewFront TopSpeed");
                return;
                }

        //Set Variables and calculations
        double OrigRear = Double.parseDouble(args [0]);
        double OrigFront = Double.parseDouble(args [1]);
        double NewRear = Double.parseDouble(args [2]);
        double NewFront = Double.parseDouble(args [3]);
        double TopSpeed = Double.parseDouble(args [4]);
        double OrigRatio = OrigRear / OrigFront;
        double NewRatio = NewRear / NewFront;
        double n = OrigRatio - NewRatio;
        double u = OrigRatio / TopSpeed;
        double p = OrigRatio + n;
        double NewTopSpeed = p / u;
        int RoundedTopSpeed = (int)NewTopSpeed;

        //Print Result
        System.out.println ("New top speed is " + RoundedTopSpeed + " MPH.");
        }
}


You'll need to copy and paste to a text editor save it as a *.java file and then compile and run it. It will work on all formats.

I've attached the *.class file, though it's uploaded as a *.txt you will need to rename it to *.class

You need Java Runtime Enviroment and run it from command line
Java Sprockets [original rear sprocket teeth] [original front sprocket teeth] [new rear] [new front] [top speed]

For example

Java Sprockets 59 16 59 18 60
 Back to top
View user's profile Send private message You must be logged in to rate posts

Acemastr
World Chat Champion



Joined: 01 Oct 2008
Karma :

PostPosted: 20:43 - 21 Nov 2010    Post subject: Reply with quote

https://www.gearingcommander.com/

Been around for years
____________________
2017 KTM 350 XC-F - 2014 Yamaha R6 - 2005 Yamaha YZ125
2016 Toyota Tacoma Limited
 Back to top
View user's profile Send private message You must be logged in to rate posts

yandy_yay
Brolly Dolly



Joined: 01 Aug 2008
Karma :

PostPosted: 20:50 - 21 Nov 2010    Post subject: Reply with quote

Acemastr wrote:
https://www.gearingcommander.com/

Been around for years


+1 ^^^^^^

Also explains about chain and sprocket wear which is quite interesting.... Well i thought it was
____________________
past bikes: (20 years ago) cg-125 (wriiten off), C-50 (thrashed n' finnaly scrapped), CZ-125 (nicked - never recovered, insurance payout was more than i paid for it !!!)
Current bikes: GN 125(now sold), Divvy 600s.
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

lihp
World Chat Champion



Joined: 22 Sep 2010
Karma :

PostPosted: 20:58 - 21 Nov 2010    Post subject: Reply with quote

That site is kind of cool!

As I said, was bored and wasted time lol. Source is there if anybody else fancies expanding on it, but I cba , it's late!
 Back to top
View user's profile Send private message You must be logged in to rate posts
Old Thread Alert!

The last post was made 15 years, 315 days ago. Instead of replying here, would creating a new thread be more useful?
  Display posts from previous:   
This page may contain affiliate links, which means we may earn a small commission if a visitor clicks through and makes a purchase. By clicking on an affiliate link, you accept that third-party cookies will be set.

Post new topic   Reply to topic    Bike Chat Forums Index -> General Bike Chat All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Read the Terms of Use! - Powered by phpBB © phpBB Group
 

Debug Mode: ON - Server: birks (www) - Page Generation Time: 0.07 Sec - Server Load: 1.31 - MySQL Queries: 14 - Page Size: 41.27 Kb