Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

points on an ellipse

Status
Not open for further replies.

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.
 
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 &quot;angle &quot; angle &quot; dx &quot; deltax &quot; dy &quot; deltay &quot; <===vars well===> &quot; $4
printf(&quot;%12.6f %12.6f %10s\n&quot;,x,y,1)
++angle
}
while (angle<=90)
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top