107 views (last 30 days)

I have a 3D equation. Can anyone help me to plot this? Thanks

John Chilleri
on 30 Jan 2017

Edited: John Chilleri
on 30 Jan 2017

Hello,

I'm certain there's a better way to do this, such as with surf, but here is a solution.

If you consider the equation, you realize that it's all planes joined by the 6 vertices {(1,0,0),(0,1,0),(0,0,1),(-1,0,0),(0,-1,0),(0,0,-1)}. These 6 vertices 'form' 8 sides.

fill3([1 0 0],[0 1 0],[0 0 1], 'r')

hold on

fill3([1 0 0],[0 1 0],[0 0 -1], 'r')

fill3([1 0 0],[0 -1 0],[0 0 -1], 'r')

fill3([-1 0 0],[0 -1 0],[0 0 -1], 'r')

fill3([-1 0 0],[0 -1 0],[0 0 1], 'r')

fill3([-1 0 0],[0 1 0],[0 0 1], 'r')

fill3([-1 0 0],[0 1 0],[0 0 -1], 'r')

fill3([1 0 0],[0 -1 0],[0 0 1], 'r')

which results in the following image:

(This is just an angle I chose to show.)

Hope this helps!

John Chilleri
on 30 Jan 2017

Opportunities for recent engineering grads.

Apply Today
## 0 Comments

Sign in to comment.