CoCalc Public Filestmp / 3d.sagetex.sage.pyOpen in with one click!
Authors: Harald Schilly, ℏal Snyder, William A. Stein
1
## -*- encoding: utf-8 -*-
2
3
4
# This file was *autogenerated* from the file 3d.sagetex.sage
5
from sage.all_cmdline import * # import sage library
6
7
_sage_const_2 = Integer(2); _sage_const_0 = Integer(0); _sage_const_4 = Integer(4); _sage_const_1p5 = RealNumber('1.5'); _sage_const_12 = Integer(12); _sage_const_16 = Integer(16)## This file (3d.sagetex.sage) was *autogenerated* from 3d.tex with sagetex.sty version 2019/01/09 v3.3.
8
import sagetex
9
_st_ = sagetex.SageTeXProcessor('3d', version='2019/01/09 v3.3', version_check=True)
10
_st_.current_tex_line = _sage_const_4
11
_st_.blockbegin()
12
try:
13
var('x,y')
14
__tmp__=var("x,y"); f1 = symbolic_expression((x**_sage_const_2 - y**_sage_const_2 )).function(x,y)
15
zmin, zmax = -_sage_const_2 ,_sage_const_2
16
cm = colormaps.Spectral
17
def c(x,y): return float((f1(x,y)-zmin)/(zmax-zmin))
18
S1= plot3d(f1, (x,-_sage_const_1p5 ,_sage_const_1p5 ), (y,-_sage_const_1p5 ,_sage_const_1p5 ),color=(c,cm),
19
frame = False)
20
except:
21
_st_.goboom(_sage_const_12 )
22
_st_.blockend()
23
try:
24
_st_.current_tex_line = _sage_const_16
25
_st_.plot(_sage_const_0 , format='notprovided', _p_=S1)
26
except:
27
_st_.goboom(_sage_const_16 )
28
_st_.endofdoc()
29
30