Nov 20, 2000 #1 gmurrie Programmer Nov 20, 2000 2 US I'm wondering if anyone has written a script to calculate points on an ellipse or a circle in awk or awk variants.
I'm wondering if anyone has written a script to calculate points on an ellipse or a circle in awk or awk variants.
Nov 27, 2000 Thread starter #2 gmurrie Programmer Nov 20, 2000 2 US Got it. This is the bones. BEGIN { angle=1 } { majoraxis=$5 minoraxis=$6 do { deltax=majoraxis*cos(angle) deltay=minoraxis*sin(angle) x=$1 + deltax y=$2 + deltay # print "angle " angle " dx " deltax " dy " deltay " <===vars well===> " $4 printf("%12.6f %12.6f %10s\n",x,y,1) ++angle } while (angle<=90) } Upvote 0 Downvote
Got it. This is the bones. BEGIN { angle=1 } { majoraxis=$5 minoraxis=$6 do { deltax=majoraxis*cos(angle) deltay=minoraxis*sin(angle) x=$1 + deltax y=$2 + deltay # print "angle " angle " dx " deltax " dy " deltay " <===vars well===> " $4 printf("%12.6f %12.6f %10s\n",x,y,1) ++angle } while (angle<=90) }