• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Allegro X PCB Editor
  3. trigonometric functions - move point on circle circumfe...

Stats

  • Replies 2
  • Subscribers 159
  • Views 1274
  • Members are here 0
More Content

trigonometric functions - move point on circle circumference

pcbnagaraj
pcbnagaraj over 13 years ago
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 = rad

oldy = 0

i = 0

printf("%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 = Newx

oldy = Newy

printf("%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 0

1 coordinates X1  Y1 : -12.79637 -99.17789 rotation 36

2 coordinates X2  Y2 : -96.72506 25.38234 rotation 72

3 coordinates X3  Y3 : 37.55096 92.68185 rotation 108

4 coordinates X4  Y4 : 87.11474 -49.10216 rotation 144

5 coordinates X5  Y5 : -59.84601 -80.11526 rotation 180

6 coordinates X6  Y6 : -71.79851 69.60585 rotation 216

7 coordinates X7  Y7 : 78.22121 62.30122 rotation 252

8 coordinates X8  Y8 : 51.77956 -85.55044 rotation 288

9 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.
  • Sign in to reply
  • Cancel
  • Ejlersen
    Ejlersen over 13 years ago

    Hi Nagaraj

    Skill has built in functions for this

    Use 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 regards

    Ole

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • pcbnagaraj
    pcbnagaraj over 13 years ago
    Excellent!! That helped.

     

    Thanks,

    Nagaraj.
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Cadence Guidelines

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information