Home > Community > Forums > PCB SKILL > trigonometric functions - move point on circle circumference

## Email

Recipients email * (separate multiple addresses with commas)

Message *

 Send yourself a copy

## Subscribe

Intro copy of the newsletter section here, some intro copy of the newsletter. Instruction of how to subscribe to this newsletter.

First Name *

Last Name *

Email *

Company / Institution *

 Send Yourself A Copy

# trigonometric functions - move point on circle circumference

Last post Tue, Aug 7 2012 1:33 AM by pcbnagaraj. 2 replies.
 Started by pcbnagaraj 06 Aug 2012 11:18 PM. Topic has 2 replies and 1480 views
• #### Mon, Aug 6 2012 11:18 PM

• pcbnagaraj
• Joined on Mon, Dec 5 2011
• bangalore, Karnataka
• Posts 55
• Points 1,130
trigonometric functions - move point on circle circumference
 Dear All, I am trying to move a point in circular rotation with an incremental angle about the origin with a constant radius value as input.. procedure( circlerotation()theta = evalstring(axlUIPrompt("Enter theta" "100"))rad = evalstring(axlUIPrompt("Enter circle radius in mils" "100"))N = evalstring(axlUIPrompt("Enter number of points # i.e. rotation increments" "10"))oldx = radoldy = 0i = 0printf("%L coordinates X%L  Y%L : %L %L rotation %L\n" i i i oldx oldy  theta*i )for( i 1 N-1 Newx = oldx * cos(theta) - oldy * sin(theta)Newy = oldy * cos(theta) + oldx * sin(theta)oldx = Newxoldy = Newyprintf("%L coordinates X%L  Y%L : %L %L rotation %L\n" i i i Newx Newy  theta*i ) ++i)) With theta as 36 and radius as 100, N as 10 I get the below coordinates the output is as below. theta value : 36:0 coordinates X0  Y0 : 100 0 rotation 01 coordinates X1  Y1 : -12.79637 -99.17789 rotation 362 coordinates X2  Y2 : -96.72506 25.38234 rotation 723 coordinates X3  Y3 : 37.55096 92.68185 rotation 1084 coordinates X4  Y4 : 87.11474 -49.10216 rotation 1445 coordinates X5  Y5 : -59.84601 -80.11526 rotation 1806 coordinates X6  Y6 : -71.79851 69.60585 rotation 2167 coordinates X7  Y7 : 78.22121 62.30122 rotation 2528 coordinates X8  Y8 : 51.77956 -85.55044 rotation 2889 coordinates X9  Y9 : -91.47302 -40.40652 rotation 324 Questions: What units are used for angle radians/degree?I observed the points are not plotted incrementally along the circle circumference in clockwise or in anticlockwise. How to move points incrementally in clockwise/anticlockwise. Any help would be appreciated. Thanks,Nagaraj.
• Post Points: 20
• #### Tue, Aug 7 2012 12:48 AM

• Ejlersen
• Joined on Mon, Jul 28 2008
• Aalborg, Copenhagen
• Posts 544
• Points 9,685
Re: trigonometric functions - move point on circle circumference
 Hi NagarajSkill has built in functions for thisUse axlGeoRotatePt for this.It takes the center, angle and point to rotate as arguments. Generally look at the Math Utility functions inside the skill reference manual, it has a lot of great functions Best regardsOle Best regards Ole
• Post Points: 5
• #### Tue, Aug 7 2012 1:33 AM

• pcbnagaraj
• Joined on Mon, Dec 5 2011
• bangalore, Karnataka
• Posts 55
• Points 1,130
RE: trigonometric functions - move point on circle circumference
 Excellent!! That helped. Thanks,Nagaraj.
• Post Points: 5