How to plot square using Algebraic function

77 Views Asked by At

I want to plot Square, i have 1 equation which plot square but in diagonal form(Like Diamond Shape),

plot r = 1/(cos(mod (t, PI/2))+sin(mod (t, PI/2))), t = 0 .. 2*PI

Live Demo Diamond Square

Please let me know how to change this equation so that it will plot square box instead of diamond shape.

Please edit this if i miss to be mention or wrong tag this post

3

There are 3 best solutions below

3
On BEST ANSWER

plot r = 1/(cos(mod (t+PI/4, PI/2))+sin(mod (t+PI/4, PI/2))), t = 0 .. 2*PI

See WA.

This square goes through the axes at $\pm\frac1{\sqrt2}$. If you want to make that $\pm1$ instead, change the numerator in the plot command to $\sqrt2$.

0
On
0
On

Center: $(a\mid b)$ .
Corner 1: $(a+c\mid b+d)$ .
Corner 2: $(a-d\mid b+c)$ .
Corner 3: $(a-c\mid b-d)$ .
Corner 4: $(a+d\mid b-c)$ .