ASKSAGE: Sage Q&A Forum - Latest question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 25 Jan 2017 12:43:23 -0600Color parametric_plot3d by a rgb color rather than a colormap.https://ask.sagemath.org/question/36386/color-parametric_plot3d-by-a-rgb-color-rather-than-a-colormap/ I know I can color a 3d plot using a function and a color map. What I would like to do is to color a plot using a function that return a rgb color directly.
Specifically, I am trying to plot complex functions on the Riemann sphere. I can show the argument using the HSV color map (which is incorrectly named since it only shows hue, not saturation nor value):
sproj(x,y,z) = (x + I*y)/(1-z)
cf = lambda u,v: N(arg(-f(sproj(cos(u)*cos(v),sin(u)*cos(v),sin(v))))/(2*pi)+0.5)
cm = colormaps.hsv
parametric_plot3d((cos(s)*cos(t),sin(s)*cos(t),sin(t)), (s,-pi,pi),(t,-pi/2,pi/2), color = (cf,cm))
This does not show the modulus, though. I would like to be able to do something like this:
sproj(x,y,z) = (x + I*y)/(1-z)
cf = lambda u,v: complex_to_rgb(-f(sproj(cos(u)*cos(v),sin(u)*cos(v),sin(v))))
parametric_plot3d((cos(s)*cos(t),sin(s)*cos(t),sin(t)), (s,-pi,pi),(t,-pi/2,pi/2), color = cf)Jan HlavacekWed, 25 Jan 2017 12:43:23 -0600https://ask.sagemath.org/question/36386/How to plot a 3D Triangle (prism) using parametric_plot3dhttps://ask.sagemath.org/question/33571/how-to-plot-a-3d-triangle-prism-using-parametric_plot3d/ I need to plot a 3d Triangle (prism), but i dont have any idea of how to make it. I try a lot of things but didn't work, please help me. ivanyosefSat, 28 May 2016 14:33:05 -0500https://ask.sagemath.org/question/33571/Mesh not appearing on 3d plothttps://ask.sagemath.org/question/8833/mesh-not-appearing-on-3d-plot/I'm trying to get a mesh to appear on a surface in Sage 4.8 using `parametric_plot3d`. Here is the code:
var('u,v')
f=[u-u^3/3+u*v^2,-v+v^3/3-v*u^2,u^2-v^2]
parametric_plot3d(f,(u,-7,7),(v,-7,7),opacity=0.7,mesh=True)
What am I doing wrong? I also can't get any of the examples from the tutorial page to show a mesh.
calc314Wed, 28 Mar 2012 04:29:26 -0500https://ask.sagemath.org/question/8833/