Go Back   Infamous Nissan - Hardbody / Frontier Forums > Model Specific > Hardbody Forum (D21)

Reply
 
Thread Tools Display Modes
Old 05-05-2018, 04:54 AM   #11
Deerhurst
4/86 SE-V6 2 tone 4x4 HB
 
Deerhurst's Avatar
 
Join Date: Apr 2013
Location: Oregon
Posts: 5,147
Vehicle: 1986.5 Hardbody
Thanks: 707
Thanked 479 Times in 442 Posts
Default

Quote:
Originally Posted by jp2code View Post
Holy crap! HandsOn and FM, those are certainly some extreme calculators!



The cool thing about these Fiddle sites:
  1. You can make whatever changes you want to the code on the screen. When you exit, it will ask if you want to save your changes. If you answer YES, it will branch off the original code and make a copy based on your changes ...and give you a slightly different URL.
  2. You do not need a compiler to make it run. It should run on the screen.
I'm not always online. I'm more familiar with visual studio though. Used it for a few years writing C++. Simple programe.
__________________
1986.5 SE-V6 4X4 D21 Hardbody
Pacesetter Long Tube Headers
Morimoto Mini D2S HID Projectors and Hella 500s
VG33i
Deerhurst is offline   Reply With Quote
Old 05-11-2018, 10:13 AM   #12
jp2code
Software Developer
 
jp2code's Avatar
 
Join Date: Dec 2011
Location: Longview, TX [USA]
Age: 49
Posts: 8,682
Vehicle: 94 LB 2x4 Manual VG33e
Thanks: 1,246
Thanked 1,080 Times in 952 Posts
Default

Some of you have mentioned in another thread that the numbers are off for your vehicles.

Does anyone see what needs to be changed in the calculation?

Code:
private const int INCHES_PER_MILE = 63360;
private const int MINUTES_PER_HOUR = 60;
	
public static double CalculateMPH(int revolutionsPerMinute, double tireHeightInInches, double axleRatio)
{
  double result = 0;
  if ((0 < revolutionsPerMinute) && (0 < tireHeightInInches) && (0 < axleRatio))
  {
    double tireHeightToMilesAround = Math.PI * tireHeightInInches / INCHES_PER_MILE;
    double revolutionsPerHour = MINUTES_PER_HOUR * revolutionsPerMinute;
    result = tireHeightToMilesAround * revolutionsPerHour / axleRatio;
  }
return result;
}
__________________
Joe (not a mechanic!) Don't have an account? EMAIL ME
Free Service Manuals: https://ownersmanuals2.com/make/nissan
Walk-through: Checking Nissan Trouble Codes
1994 VG30E to VG33E with H256 Cams

jp2code is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:16 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.