How to Set Up Equations for a Shape with a String Constraint Around a Rectangle?

  • I
  • Thread starter liquidFuzz
  • Start date
  • Tags
    Set Shape
In summary: I attached the excel I tried the calculations in. There you can see the segments I still haven't got, the corners. Oh, I should mention that I used Libreoffice for this tinkering.C and D are the focal points at ##(\pm{a\over 2}, {b\over 2})##. The ellipse section has equation $$\left (x\over E1a\right )^2+ \left (y- b/2\over E1b\right )^2 = 1\ ,$$valid between the blue points (above C and D), so for ##{a\over 2}\le x \le {a\over 2}##.If this
  • #1
liquidFuzz
103
6
TL;DR Summary
Geometry string around ractangle
I have a shape based on the idea of having a string, a closed loop, that is sitting outside a rectangle. The string is d longer than the circumference of the rectangle. I noted the sides as a and b. The shapes is formed by drawing a line around the rectangle with the string as a constraint of how far from the rectangle the line shall be. Im able to set up an equation discribing the shape along each side, a and b that is. I get stuck when I try to set up an equation describing the shape in the corners where the points, or line, is drawn around the corners of the rectangle.

Feel free to chime in. Its for some ideas i have for wood working.
 
Mathematics news on Phys.org
  • #2
FactChecker said:
So the string should form a quarter circle
Beg to differ: I find an ellipse that is rotated by ##\pm\arctan{b\over a}##
Having good fun trying to draw the thing using Excel ?:)

##\ ##
 
  • Like
Likes FactChecker
  • #3
BvU said:
Beg to differ: I find an ellipse that is rotated by ##\pm\arctan{b\over a}##
Having good fun trying to draw the thing using Excel ?:)

##\ ##
Thanks BVU! I just need a software able to plot the points/lines. I think I'm going to use this shape for some cnc-stuff so excel won't cut the cheese.

Would you mind elaborate on how you derived at the arctan() solution?

Thanks Factchecker for the input!
 
  • #4
liquidFuzz said:
Would you mind elaborate how you derived at the arctan() solution?
With your choice of variables the rectangle has corner points ##(\pm{a\over 2},\pm{b\over 2})##.

The string is tight along three sides for the part you have already figured out: ellipses (ellipse sections) with center ##(0,\pm{b\over 2})## and ##(\pm{a\over 2},0)##. Focal points are adjacent points on the rectangle.
In the corners the string is tight along two sides and you get ellipses with focal points on diagonally opposite points.

Still chewing on the math.

##\ ##
 
  • #5
BvU said:
Beg to differ: I find an ellipse that is rotated by ##\pm\arctan{b\over a}##
Having good fun trying to draw the thing using Excel ?:)

##\ ##
Thanks. I stand corrected. I misread "constraint" as "constant".
 
  • #6
FactChecker said:
Suppose the string is at a constant distance from the rectangle
I think OP is drawing a curve around "four pins", in the same manner as a simple ellipse is drawn with a string around two pins.

##\ ##
 
  • Like
Likes FactChecker
  • #7
For the "sides" I came up with this, which seems to be right when I plot it.
##y(x)=\frac{\sqrt{e}*\sqrt{2x+e}*\sqrt{4a^{2}-4ax+4ea-2ex+e^{2}}}{\sqrt{4a^{2}+8ea+4e^{2}}}##

y is the displacement, for lack of better word, from this rectangle sides.

Edit, e is the extension of the string, i.e. the length of the string is 2a+2b+e
 
  • #8
Where is ##b##, what is ##e## ?:smile:

My math is too rusty and my abstraction level has sunk below what's needed to adopt your ##a## and ##b## :cry:

##\ ##
 
  • #9
As I wrote in the first post, the sides of the rectangle are a and b. e is the extension of the string, thus the string is 2b+2b+e.
 
  • Like
Likes BvU
  • #10
OK (2a+2b+e, that is).

Managed to fumble the three ellipses in Excel ?:)

1667836988067.png


Main headache was variable naming (your ##a## and ##b## versus theirs) :smile:
And, of course, the almost unavoidable chaotic Excel unstructured programming.

For what it's worth I added the ?:)
 

Attachments

  • Ellipses.xlsx
    20.1 KB · Views: 103
  • #11
I'm not sure I follow your calculations BVU. Is it what I'm looking for..?

I attached the excel I tried the calculations in. There you can see the segments I still haven't got, the corners. Oh, I should mention that I used Libreoffice for this tinkering.

Edit, these spread sheets are a bit sluggish, so it is not possible to change the number of data-point. However, it was fairly easy to plot the equations to see how they held up.
 

Attachments

  • ellipsish shape.xlsx
    15.3 KB · Views: 114
  • #12
liquidFuzz said:
I'm not sure I follow your calculations BVU
How can I help ? Did you understand post #4 ?

liquidFuzz said:
Is it what I'm looking for..?
In view of an earlier
liquidFuzz said:
I just need a software able to plot the points/lines.
I am inclined to answer "yes" to that :smile:

In #10 I only bothered for one quadrant. My example has a relatively large ##e## so the corner section is large too and I was able to check for a few points with a ruler.

Can you at least follow what I did for the sides (E1 and E2) ?

I have a hard time to understand your spreadsheet too. Spreadsheets are like that.
I wonder how you can get so far away from the rectangle with an ##e## of only 0.55 cm ...

##\ ##
 
  • #13
liquidFuzz said:
I'm not sure I follow your calculations

BvU said:
Did you understand post #4 ?
Does this help for the top ellipse section in my example ?
1667856303812.png
C and D are the focal points at ##(\pm {a\over 2}, {b\over 2})##. The ellipse section has equation $$\left (x\over E1a\right )^2+ \left (y- b/2\over E1b\right )^2 = 1\ ,$$valid between the blue points (above C and D), so for ##{a\over 2}\le x \le {a\over 2}##.

If this is clearing it up for you, I can try to add E2 and E3.

##\ ##
 
  • #14
BVU, I have read all your posts. Stating "I'm not sure I follow you" was me trying to be polite about the fact that your approximation is not so good. :angel: The shape is ellipsoid in appearance but it is not an ellipsoid.

So, as stated before. I have an analytical expression for the sides. Trying to tackle the corners segments I have been approximating the contour by approximating it to Bézier splines. This seems to be a good approximation. However, the analytical expression for the shape's corner segments still eludes me. :cry:
 
  • #15
liquidFuzz said:
The shape is ellipsoid in appearance but it is not an ellipsoid.
How can you say that ? AFIK the equation for an ellipse is as stated ! And there is no approximation.

The Visio drawing in #13 is a genuine ellipse !
(Currently having fun with Visio to draw the corner ellipse). E2:

1667858841558.png

The E2a =17.3 mm is actually ##\sqrt 3##. Ellipse equation between the blue points straightforward$$
\left (x-a/2\over E2a\right )^2+ \left (y\over E2b\right )^2 = 1\ ,$$

Sorry about switching from cm to mm. Visio thing.

##\ ##
 
  • #16
1667860189632.png

Genuine ellipses ! Corner section between the arrows.

liquidFuzz said:
I have an analytical expression
Somewhat different from the earlier
liquidFuzz said:
I just need a software able to plot the points/lines
:wink:
But once the math is in place it's straightforward to write the ellipse equation, whether standard ( ##(x/a)^2 + (y/b)^2 = 1) ## or as y=f(x).As a physicist I'm happy to have cracked this. As a woodworker I would just grab a file or a plane :smile:

##\ ##
 
  • #17
How big is e, in your approximation?

Cool! I also hold a masters degree in physics. :-)
 
  • #18
liquidFuzz said:
How big is e, in your approximation?
There is no approximation. In the example e is 2.

1667924470550.png


:smile:

[edit] the 2 became 2 cm in the Visio drawing. However, the annotations were in mm :oldgrumpy:

##\ ##
 
  • #19
I tried your excel-file and it crashes as soon as I edit length, width, and string length. :-/

My don't crash so I stick with the analytical solution for now. I think I'll just go with brute force for the corners, when I have some spare time.
 
  • #20
liquidFuzz said:
I tried your excel-file and it crashes as soon as I edit length, width, and string length. :-/
Yes, it's not a production version :smile: : No error handling for a < b for example, let alone dealing with that.

But it's straightforward, so once you understand it, it can still be useful.

liquidFuzz said:
brute force for the corners
Is it clear what the exact solution is ?
Interesting from a math point of view.
For FWW (Fine woodworking) anything approximate is good enough IMHO...

Nice exercise, though !

##\ ##
 
  • #21
BvU said:
For FWW (Fine woodworking) anything approximate is good enough IMHO...

Nice exercise, though !

##\ ##
True! I have transferred the shape into a CAD program and I had to calculate (approximated) Bézier splines to keep the nodes at a reasonable level. I think I ended up with 12 nodes or so to get a smooth contour that was fairly similar to the shape I was going for. The continuation of this is just my stubbornness. :-)
 
  • Like
Likes BvU

FAQ: How to Set Up Equations for a Shape with a String Constraint Around a Rectangle?

How do I set up equations for finding the perimeter of a rectangle?

To find the perimeter of a rectangle, you can use the formula P = 2(l + w), where P is the perimeter, l is the length, and w is the width of the rectangle. Simply plug in the values you have for length and width and solve for P.

What is the equation for finding the area of a circle?

The equation for finding the area of a circle is A = πr², where A is the area and r is the radius of the circle. Remember to use the value of π as 3.14 or a more accurate approximation.

How do I set up equations for finding the volume of a rectangular prism?

The equation for finding the volume of a rectangular prism is V = lwh, where V is the volume, l is the length, w is the width, and h is the height of the prism. Simply plug in the values you have for length, width, and height and solve for V.

What is the formula for finding the surface area of a cylinder?

The formula for finding the surface area of a cylinder is SA = 2πr² + 2πrh, where SA is the surface area, r is the radius, and h is the height of the cylinder. Remember to use the value of π as 3.14 or a more accurate approximation.

How do I set up equations for finding the perimeter of a triangle?

To find the perimeter of a triangle, you can add the lengths of all three sides. You can also use the formula P = a + b + c, where P is the perimeter and a, b, and c are the lengths of the three sides. If you have the measurements of the angles, you can also use the Law of Cosines to find the length of the third side and then use the formula P = a + b + c to find the perimeter.

Back
Top