05-08-2023, 06:22 AM
(This post was last modified: 05-08-2023, 06:45 AM by checkpoint10.)
(05-07-2023, 07:13 AM)Dennis Wrote: g[1]=2*y[0]+tg(i[0])+tg(i[1])-2*y[1]Thanks for working out this math. When you say that i is the grade, is that the value that appears in the SG file, the angle in degree or radian, or some other number?
g[2]=3*y[1]-3*y[0]-2*tg(i[0])-tg(i[1])
g[3]=tg(i[0])
where y is the altitude divided by the sector length, i is the grade, the indices 0 and 1 refers to the start and the end of the sector
The math behind it is attached. I didn't clean it up.
Edit: While investigating this, I found that the grade value in the SG file is:
Grade per SGE (in degrees) * pi/180 * 8192, rounded to the nearest integer
I believe 8192, which is 2^13, was chosen as a multiplier to make sure the value within the SG file would be an integer