Forgot password?

Create an account!

Forum

« back

Python – Convert Vector to Polar Angle

Messages

Please log in to write a message.

  • 2. beezerlm (May 11, 2017 21.01):

    I received an answer from MarcusStrube on another forum that works well. As follows:

    "
    import math
    import Rhino.Geometry as rg

    for v in [[1,0,0], [0,1,0], [-1,0,0], [0,-1,0]]:
    rad = rg.Vector3d.VectorAngle(rg.Vector3d.XAxis, rg.Vector3d(*v), rg.Plane.WorldXY)
    deg = math.degrees(rad)
    print deg
    "

  • 1. beezerlm (May 11, 2017 15.58):

    I am trying to write a script that converts a vector to a polar angle on my current Cplane. For example:

    [1,0,0] = 0°
    [0,1,0] = 90°
    [-1,0,0] = 180°
    [0,-1,0] = 270° (or -90° would work too)

    what would be the easiest way to accomplish this with a known vector?

Recommend

Why are these buttons gray?