Home Forums Nazca Questions and Answers How to draw a rotationally symmetric waveguide?

Tagged: 

This topic contains 3 replies, has 2 voices, and was last updated by  Ronald 3 months, 3 weeks ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #5328

    willie_woud
    Participant

    How to draw a rotationally symmetrical graphics centered on a certain point in nazca. As follows.

    #5332

    Ronald
    Keymaster

    Dear willie_woud,

    The picture link you added seems not to open without login to the site it is on.

    Ronald

    #5335

    willie_woud
    Participant

     

    I updated the image link as follows

    https://upload-images.jianshu.io/upload_images/794408-07dfd2950df72cf6.png

     

    • This reply was modified 3 months, 3 weeks ago by  Ronald. Reason: copied picture locally to make it visible
    #5337

    Ronald
    Keymaster

    Dear willie_woud,

    Place objects with trigonometric functions

    # Assuming OB is your polygon, polyline or cell object
    
    import nazca as nd
    from math import sin, cos, radians
    OB = nd.Polygon(points=[(-5, 0), (5, -5), (5, 5)])
    R = 30
    N = 6
    for n in range(N):
        a = 360*n/N
        OB.put(R*cos(radians(a)), R*sin(radians(a)), a)
    nd.export_plt()

    Ronald

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.