Distance is in Km.  If I recall the starting point was the Penguin
Picnic area (where the Gat RR used to start).

>>>>> "Bob" == Simpson, Bob <[EMAIL PROTECTED]> writes:

    Bob> What units are the 'distances" in.  Fortune Lake is about
    Bob> 2.25 km long (7.34 - 5.19).  Is that 5.19 km from some
    Bob> starting point?  Obviously that first 8.36% isn't for the
    Bob> first 5.19 km.  Is it an instantaneous measurement of the
    Bob> grade at that point?  Percent grade to 5 decimals.
    Bob> Impressive accuracy.  I would guess that rolling over a
    Bob> pebble would cause a change of more than 0.00001%!  LOL

Mea culpa.  What can I say for an awk script I whipped together in a
couple of minutes which was used to feed a plotting program.  Rounding
to the "correct" accuracy is rather irrelavent for the intended
application as one can't really make out too many places of accuracy
when plotted.  I believe the distance measurements are out by 1% too.
Elevations were measured barometrically, so they aren't all that
precise either.

It is left as an exercise to the reader to change "print" to "printf"
with appropriate args.  "d" is difference in distance in kilometres as
measured by the Avocet.  "h" is difference in elevation in metres as
measured by the Avocet.  "grade" is percent grade.

BEGIN { oldd = 0; oldh = 0; maxgrade = 0 }
{ 
  d = $1 - oldd; oldd = $1;
  h = $2 - oldh; oldh = $2;
  d = d * 1000;
  if ( d * d > h * h ) grade = h * 100 / sqrt( d * d - h * h ); else grade = 0;
  if ( maxgrade * maxgrade < grade * grade ) maxgrade = grade;
  print $1, $2, grade
    }
END { print "Max grade is ", maxgrade }

Note: awk doesn't have 'abs()', so x * x is used to get
unsigned magnitudes.  Why bother with extra comparisons????  :-)

------
To unsubscribe, send a blank message to [EMAIL PROTECTED]
Club Office:      [EMAIL PROTECTED],  (613) 230-1064
Web/mailing list: [EMAIL PROTECTED]    http://www.cyberus.ca/~obcweb
Newsletter:       [EMAIL PROTECTED]   http://www.cyberus.ca/~obcweb/Newsletter

==^================================================================
EASY UNSUBSCRIBE click here: http://topica.com/u/?aVxiDo.a2i8p1
Or send an email To: [EMAIL PROTECTED]
This email was sent to: [email protected]

T O P I C A -- Register now to manage your mail!
http://www.topica.com/partner/tag02/register
==^================================================================

Reply via email to