Grasshopper

algorithmic modeling for Rhino

Hello,

I'm trying to create a Waldram diagram. I have code that creates curves that almost match it, but not quite.

The Waldram Diagram has an X and Y axis with values which both represent degrees. I believe one of the curve's formula is some variation of y*sin(x), as every Y value at 0 x is equal to itself (sin of 0 is 1). The other seems to be a variation of y*cos(x), as every Y value at 0 is equal to 0 (cos of 0 is 0).

Oddly enough there isn't much information online that I could find explaining how to plot a Waldram diagram. I have attached a picture of what I currently output, my desired output, and my code (zip file with visual studio solution).

Thank you!

Views: 3256

Attachments:

Replies to This Discussion

I gave it a look, It is not simple. I just manage to find a transformation for the ordinate, it is an S-curve. See the script if it helps. 

Attachments:

https://www.researchgate.net/publication/245507022_Waldram_was_wrong <- check this paper

There is the excel formula for plotting the graph.

P = 1-(COS((2*(DEGREES(ATAN(TAN((a)*PI()/180)*COS((b)*PI()/180))*PI()/180)))))

P being?

I believe P is the Y value. I had trouble with the conversion in python, so I wrote a plugin to plot this in C#. Got very close, but some of my values are a bit off, such that my curves are correct but the Y values are all a bit too large. I'm going to keep trying and see what my problem is but if anyone else wants to try (in python or C#) please post results.

This was my first round of results, as you can see the curve is pretty good, however the top curve should have a maximum y of 90, which it goes above

updated code:

Attachments:

Thanks it is more easy with the good equation. In red GH curve exactly on black curve.

This equation has the same issue as the code I posted. While the curve is the same, the units are off, as seen in my screenshot where the ymax goes well above 80

I don't understand the problem, there are 10 curves, one for a=0°, and a=10° ... to a=90°. For a = 90°, the result is 90, indeed 2 if not multiplied by 45 as I did. 

With a ranging from 0 to 90° 

b from -90° to 90°

the formula  P=(1-(cos((2*(atan(tan((rad(a)))*cos(rad(b))))))))

P goes from 0 to 2. 

Am I mistaken on how rhino's coordinate system works? Because when I count the coordinates (see my screenshot) it looks like the top line is above 100, and none of the lines intersect at exact points (10, 20, 30, 40, 50). Yes, it does match up over top the document, but it doesn't seem to be plotting at the exact points.

Well your grid certainly doesn't seem to go to 100. It seems to only go to 70. Isn't the diagram supposed to go all the way up to 90?

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2021   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service