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.Mon, 27 Jun 2022 16:36:05 +0200How can we label 3d cube?https://ask.sagemath.org/question/63031/how-can-we-label-3d-cube/If we use cube() function we get a nice cube without vertices labelled. I could not find any inbuilt method to label vertices. Is there any way to do this?aakkbbMon, 27 Jun 2022 16:36:05 +0200https://ask.sagemath.org/question/63031/Square, 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 ')wisherTue, 15 Dec 2020 11:00:00 +0100https://ask.sagemath.org/question/54682/How to make a program for rubik's cube?https://ask.sagemath.org/question/31712/how-to-make-a-program-for-rubiks-cube/ Hello, I'm working on a rubik's cube project. I want to make a program:
1/ enter a permutation of the Cube Group
2/ enter the position of one of the 8 vertexes of the cube
3/ get the new position of the vertex.
Here are the name of the positions (notations of Singmaster):
one= 8,25,19
two= 6,17,11
three= 1,9,35
four= 3,33,27
five= 43,24,30
six= 41,16,22
seven= 46,40,14
height= 48,32,38.
For example, I choose the vertex which is on the position one: 8, 25, 19 and I choose the permutation U (Up). After the permutation, the vertex will be on the position two: 6, 17, 11.
My problem is:
1/ to find a code for the 8 possible positions of the vertexes.
2/ to make the program understanding that I want him to give me the the new position of the vertex after the permutation.
Thank you for your help!BrizouSun, 20 Dec 2015 15:56:15 +0100https://ask.sagemath.org/question/31712/Get variants of complex cube-roothttps://ask.sagemath.org/question/10063/get-variants-of-complex-cube-root/I found-out that complex cube-root can have 3 variants (see http://en.wikipedia.org/wiki/Cube_root)
But if I try in SageMath to do
(-1)^(1/3)
SageMath return (-1)^(1/3). When I try
(-1)^(1/3).n()
SageMath gives me numerical approximation of the one root (not real)...
How I can get all variants of complex cube-root without numerical approximation?
Thanks! P.S. Sorry for poor English...avi9526Thu, 25 Apr 2013 15:31:30 +0200https://ask.sagemath.org/question/10063/Compute the volume of a cube regionhttps://ask.sagemath.org/question/10834/compute-the-volume-of-a-cube-region/Hi,
I would like to compute the volume $V$ of the lower polyhedron (that does not contain vertex A) let's call it $poly_G$. (let's call $poly_A$ the upper polyhedron that does not contain G). Size is $a=AB=BF=...$
![cube](http://s1.e-monsite.com/2009/06/01/11/67920229cube-et-diagonale-gif.gif "cube")
We can compute $V_{poly_A}$ by introducing K and I points and using Pythagore's theorem and median's properties . I can do that by hand using $V_{poly_G}=V_{cube}-V_{poly_A}$
I want to compute the volume with sage, I have tried this code using volume integrations but I am not sure about the result at all... I look at first for the normal vector of plane DBE (cross product) which gives the equation plane $x-y+z$. Then I compute using triple integrations.
x=var('x')
y=var('y')
z=var('z')
a=var('a')
u=vector([a,a,0])
v=vector([0,a,a])
print u.cross_product(v)
intz = integrate(1,z,0,a-y-x)
inty = integrate(intz,y,0,a-x)
intx = integrate(inty,x,0,a)
print intx
I would like to know if there are elegant ways of computing this kind of problem in sage ? And in addition, if this require few lines, how can I display the above figure ? Sorry if this looks simple, I am new to Sage.
Thanks,coincoinSun, 15 Dec 2013 14:15:52 +0100https://ask.sagemath.org/question/10834/