Grasshopper

algorithmic modeling for Rhino

Hi,

I have a problem with math rather than Grasshopper. :)

I need to draw lines according to spherical coordinate.

If you see the image,I want to draw lines with 120° (XY plane) and 39° according to their plane.

In this example you see that the angle is 33.6°, but I don't know how to achieve 39°: Which is the formula?

Thank you!

Views: 1902

Replies to This Discussion

Must be some mistake in your definition.

Get this and have fun (open C# and see maths involved): from Cartesian to Polar and back.

Attachments:

Hi Peter,

it has been a while...

Thank you for your reply, but my issue is different. I don't want to determinate a polar coordinate from X,Y,Z and neither from θ (longitude) or φ (latitude).

I want to determinate a line, from origin (0), angle in XY (longitude) and the angle between the two lines (alfa), because I need to put lines touching point 0 having minimum distance of 39°

My dear Watson ... I confess that ... well ... maybe this? (note: we must compare apples to apples with these mysterious coordinate systems, he he).

Oops

PS: maybe this is MIA from your input?:  RhinoMath.ToDegrees (rad_value) or the other thing (most probably, he he)

Attachments:

If I use your script, I just have polar coordinate, like @100<120<39, where 100 is the lenght, 120 longitudinal angle and 39 latitude.

I can't fix latitude in advance,  but I have to find the latitude, the only one let me to have two lines separated by a fixed value (for example 39°). For sure there is a formula that gives me that value.

I don't know if it is clear

Clear is not (but that's tradition between our communication, love trad stuff he he)

Last hint before harakiri: 120,39 are degrees ... the C# thingy speaks Polar Bear language and needs values in radians (RhinoMath.ToRadians(degree_value)).

Since you've mentioned 2 lines can you describe  in steps the issue (oversimplified for idiots, like yours truly).

WAIT a minute: you have one #$%#$ Line1 fixed in place and you have to find another @$%@ Line2:

(a) where Line2.Polar = something1 AND

(b) where (Vector3d.VectorAngle(Line1.Direction, Line2.Direction)) = something2? AND

(c) where Line2.Elev = something3?.

I feel a bit dizzy, pass me the Vodka please, he he.

don't say that! :D

reset everything, but every every everything.

Let's start from the only one image.

1) In the left part you see red lines in top view and in the right one in axo

2) I want  the three red lines with an angle in plan (XY) of 120° between each other

3) In axo view, you see that they are 33.6° between each other (considered the plan composed by two lines), but still 120° in XY of course (it's just a different view, not different drawing). This is a fxxxng random angle, just an example. 

now...

4) I wish to decide which is the angle and I want to have, for example, 39° instead 33.6, but I want to KEEP 120° in XY.

It means that the red lines will go a little bit down. Try to imagine an umbrella that is going to open... ahaha forget the umbrella please! (you know what I mean)

5) HOW TO DRAW THESE FXXXNG LINES?

I appreciate a lot :D

hello User,

I believe this is what you are after:

The function comes from simple trigonometric operations starting from the triangles on the xy plane and going to the triangles in 3d space.

I am pretty sure it can be simplified but I can't seem to find out how.

If you are interested on the calculation steps let me know and I will try to explain them.

cheers,

nikos

Attachments:
Fantastic! That's what I needed. I know, I'm too lazy and I have to study again trigonometry!

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service