ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 15 Dec 2020 23:42:31 +0100Square, cube, octahedron, equationshttps://ask.sagemath.org/question/54682/square-cube-octahedron-equations/We know that $|x| + |y| - 1 = 0$ is the equation of a square having its vertices on the axes.
I asked to represent the equation $|x| + |y| + |z| - 1 - 0$, believing to obtain a cube in space.
But I obtain an octahedron. Why? And how do you get a cube?
# with SageMath 7.3
var('x, y, z')
f = abs(x) + abs(y) + abs(z) - 1
implicit_plot3d(f, (x, -1, 1), (y, -1, 1), (z, -1, 1), color='aquamarine ')Tue, 15 Dec 2020 11:00:00 +0100https://ask.sagemath.org/question/54682/square-cube-octahedron-equations/Answer by tmonteil for <p>We know that $|x| + |y| - 1 = 0$ is the equation of a square having its vertices on the axes.</p>
<p>I asked to represent the equation $|x| + |y| + |z| - 1 - 0$, believing to obtain a cube in space.</p>
<p>But I obtain an octahedron. Why? And how do you get a cube?</p>
<pre><code># with SageMath 7.3
var('x, y, z')
f = abs(x) + abs(y) + abs(z) - 1
implicit_plot3d(f, (x, -1, 1), (y, -1, 1), (z, -1, 1), color='aquamarine ')
</code></pre>
https://ask.sagemath.org/question/54682/square-cube-octahedron-equations/?answer=54683#post-id-54683This is not really a Sage question, rather a mathematical question. What you are drawing is the unit ball of the L1 norm, which is an ocatahedron. If you want to obtain a cube, you should rather draw the unit ball of the L-infinity norm. This norm does not sum the absolute values of the coordinates, but it takes their maximum.
Note that the maximum for symbolic expression, is `max_symbolic`.Tue, 15 Dec 2020 11:09:06 +0100https://ask.sagemath.org/question/54682/square-cube-octahedron-equations/?answer=54683#post-id-54683Comment by wisher for <p>This is not really a Sage question, rather a mathematical question. What you are drawing is the unit ball of the L1 norm, which is an ocatahedron. If you want to obtain a cube, you should rather draw the unit ball of the L-infinity norm. This norm does not sum the absolute values of the coordinates, but it takes their maximum.</p>
<p>Note that the maximum for symbolic expression, is <code>max_symbolic</code>.</p>
https://ask.sagemath.org/question/54682/square-cube-octahedron-equations/?comment=54688#post-id-54688Thank you for your reply. She made me understand that I have math gaps. I'm going to check out math sites to try and figure out what L-infinity norm is. I have cut out!Tue, 15 Dec 2020 23:42:31 +0100https://ask.sagemath.org/question/54682/square-cube-octahedron-equations/?comment=54688#post-id-54688