View Full Version : a question for visual basic.net programmers
roihandicapping
02-08-2008, 06:07 AM
I want to use the time of 112.0 to equal 100 (pace figure) as my base and every second faster or slower to equal .5 points (1/2 points)
Here is my time chart
112.3 = 98.5
112.2 = 99
112.1 = 99.5
112.0 = 100 (Base rating)
111.9 = 100.5
111.8 = 101
111.7 = 101.5
111.6 = 102
How to do I write the code in visual basic.net
I'm brand new to programming only 3 weeks.
Hammerhead
02-08-2008, 07:21 AM
How about a lookup table
kgonzales
02-08-2008, 08:39 AM
Roi,
I don't know VB code but the formula structure could be:
460 - T*5
where T= final time in seconds
I'm assuming by 112 you mean 1:12.0 or one minute and twelve seconds, so you need to convert that to 72 seconds.
-kg
bigchump
02-08-2008, 11:57 AM
Here is my time chart
112.3 = 98.5
112.2 = 99
112.1 = 99.5
112.0 = 100 (Base rating)
111.9 = 100.5
111.8 = 101
111.7 = 101.5
111.6 = 102
I'm assuming you want to convert this formula to VB code:
//example for slower horse
112-112.3=-0.3 //subtract the final time from your base
-0.3*5=-1.5 //multiply by five
100+(-1.5)=98.5 //add -1.5 to 100
//example for faster horse
112-111.6=0.4
0.4*5=2
100+2=102
//simplified VB code
Dim BASE as Decimal = 112
Dim TIME as Decimal
Dim PACE as Decimal
PACE=100+(5*(BASE-TIME))
kid4rilla
02-12-2008, 11:36 AM
public static double GetPaceFigure(double seconds)
{
double diff = ((72 - seconds)/0.1)*0.5;
return 100+diff;
}
vBulletin® v3.8.9, Copyright ©2000-2024, vBulletin Solutions, Inc.