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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

How to draw rectangle and triangle from dots?

Cornel
19-Tanzanite

How to draw rectangle and triangle from dots?

Hello,

1. Given the below points: (x1,y1), (x1,y2), (x2,y1), (x2,y2), how to make a rectangle in Mathcad Prime based on this points?

Cornel_0-1690892356799.png

 

2. Given the below points: (x1,y1), (x2,y1), (x3,y2), how to make a triangle in Mathcad Prime based on this points?

 

Cornel_1-1690892453947.png

 

ACCEPTED SOLUTION

Accepted Solutions
LucMeekes
23-Emerald III
(To:Cornel)

You can do both with this simple function:

LucMeekes_0-1690893428181.png

where pl is a nx2 matrix of (x,y) points. Examples:

LucMeekes_1-1690893479123.png

LucMeekes_2-1690893487306.png

LucMeekes_3-1690893515589.png

Success!
Luc

View solution in original post

6 REPLIES 6
LucMeekes
23-Emerald III
(To:Cornel)

You can do both with this simple function:

LucMeekes_0-1690893428181.png

where pl is a nx2 matrix of (x,y) points. Examples:

LucMeekes_1-1690893479123.png

LucMeekes_2-1690893487306.png

LucMeekes_3-1690893515589.png

Success!
Luc

Cornel
19-Tanzanite
(To:LucMeekes)

Is it possible also to put some colour inside the square/rectangle?

Cornel_0-1690895148677.png

 

LucMeekes
23-Emerald III
(To:Cornel)

Sure, refer to the other thread on colour filling.

 

Success!

Luc

ttokoro
20-Turquoise
(To:Cornel)

image.pngimage.pngimage.pngimage.pngimage.pngimage.png

ttokoro
20-Turquoise
(To:ttokoro)

image.pngimage.png

 

image.pngimage.png

This is only p1=[3,1],p2=[5,7],p3=[7,1] type.

ttokoro
20-Turquoise
(To:Cornel)

image.pngimage.pngimage.pngimage.png

Announcements

Top Tags