Skip to main content
24-Ruby IV
April 4, 2018
Question

Distance between a point and a square, triangle etc

  • April 4, 2018
  • 2 replies
  • 3555 views

I have a function for the calculation the distance between a point and a square.

See please the animation and the Mathcad sheet in attach.

Point-Square.gif

My questions:

0. Do you know some references on this topic - an ellipse with not point-focuses but with circles etc?

1. Can the function Square be mote simple?

2. I need one more argument for the function Square - an angle alpha - the rotation of the square from 0 to 90 deg.

3. Help me to create the function Triangle (Rhombus, Rectangle, Ellipse, etc.) with same properties!

 

I need it for this... art

New art form with Mathcad

 

 

2 replies

16-Pearl
April 4, 2018

Not an exact solution, but this is close.  I divide each line into segments and pick the closest of all the points. 4.0 and pdf attached.

 

2018-04-04_11-35-09.jpg

24-Ruby IV
April 4, 2018

Thanks DJF!

I will try to convert your solution to MC15 and create the function Square(x, y, alpha, p, xs, ys).

The function without alpha:

xyp.png

24-Ruby IV
April 5, 2018

One simple example - a vertical offcut.

Wee need an angle alpha in the function OffCut!

Point-Offcut.gif

 

Point-Offcut.png

24-Ruby IV
April 5, 2018

See one animation of new Ellipse

point-offcut.gif

24-Ruby IV
April 5, 2018