-1

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

Gerry Myerson
  • 179,216
Aamir
  • 103

3 Answers3

0

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$.

David
  • 82,662
0

r = 1/cos(0.25arccos(cos(4x))

might be simpler but yh

http://www.wolframalpha.com/input/?i=plot+r+%3D+1%2Fcos%280.25arccos%28cos%284x%29%29

0

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)$ .