Grasshopper

algorithmic modeling for Rhino

Hi there, 

I need a help with this one

The problem is as follows:

I begin by creating a square. Its dimension is determined by the square root of the area (first input slider). What I'd like to do next is to scale it non-uniformly so that I can get a rectangle with a specific proportion. This proportion (my second input slider) is always larger than 0 and below 1. ie. I have a square with an area of 36, and its sides are 6. My input proportion is 0,25. How can use this to get a rectangle of 3x12? or if my input proportions is 0,44, how can I use this to get a rectangle of 4x9? It is important that the initial area I input is the same area of the final rectangle, and that this rectangle have the same proportion I use as second input. 

Maybe this is more of maths question, but still worth giving it a shot and asking for some advice. Any help would be much appreciated. 

Thanks in advance

Views: 1521

Replies to This Discussion

Let your rectangle have dimensions L & B (length and breadth), its area is A, and it's proportion is K

You have two simultaneous equations:

1) L*B=A

2) L/B=K

From 2), L=B*K

Sub into 1), B*B*K=A

so, B=Sqrt(A/K), and from there find L

Thanks you for the help it was perfect!

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service