cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Distance between a point and a square, triangle etc

ValeryOchkov
24-Ruby IV

Distance between a point and a square, triangle etc

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

 

 

8 REPLIES 8

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

ValeryOchkov
24-Ruby IV
(To:DJF)

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

One simple example - a vertical offcut.

Wee need an angle alpha in the function OffCut!

Point-Offcut.gif

 

Point-Offcut.png

See one animation of new Ellipse

point-offcut.gif

A equilateral triangle

Point-Triangle.gif

More correct function and animation:

Point-Triangle.gif

An Ellipse with a circle, a square and a triangle as focuses:

New-Egg-Meisen-L.gif

Top Tags