Kernel: SageMath 10.6
In [1]:
Out[1]:
(3.14159292035398, 3.14159265358979)
In [0]:
In [0]:
#STARTTEXT
This problem suggests lots of other problems. Here's one: Given two intersecting circles find the set of points equidistant from each circle.
Coordinatize the circles so that the larger one (or either one if they are the same size) is the unit circle and the other one has center with and radius . Since the circles intersect, we have and . From rough sketches, we can see the set is going to be an oval shape passing through the two points of intersection of the circles. We use Sagemath's symbolic calculator to work out the equation for the set .
#ENDTEXT
In [66]:
Out[66]:
[
s == -1/2*(c^2 - r^2 - 2*c*cos(1/180*pi*t) + 1)/(c*cos(1/180*pi*t) - r - 1)
]
In [5]:
Out[5]:
1
In [0]:
In [0]:
In [0]:
In [6]:
Out[6]:
Next
In [20]:
Out[20]:
[
s == 1/2*(2*r*cos(1/180*pi*t) - 1)/(r*cos(1/180*pi*t) - r - 1)
]
In [0]:
In [40]:
Out[40]:
[
s == ((r - 1)*cos(1/180*pi*t) - r + 1)/((r - 1)*cos(1/180*pi*t) + r + 1)
]
In [43]:
Out[43]:
In [0]:
In [16]:
Out[16]:
[
s == -1/2*(c^2 - 2*c*r - 2*(c - r)*cos(1/180*pi*t) + 1)/((c - r)*cos(1/180*pi*t) - r - 1)
]
In [0]:
In [72]:
Out[72]:
-1.38777878078145e-16
In [76]:
Out[76]:
0.6949152542372881355932203389830508474576271186440677966101694915254237288135593220338983050847457627
In [0]:
In [28]:
Out[28]:
[-1.32814766129474e-18, -2.71050543121376e-18, -2.10335221462188e-17, -1.51788304147971e-18, -8.67361737988404e-19, -1.30104260698261e-17, -3.42607886505419e-17, 9.54097911787244e-18, 6.93889390390723e-18, 1.56125112837913e-17, 5.20417042793042e-18, -6.93889390390723e-18, 1.38777878078145e-17, -1.73472347597681e-18, -6.93889390390723e-18, -1.38777878078145e-17]
In [29]:
Out[29]:
-1.38777878078145e-16
In [1]:
Out[1]:
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
Cell In[1], line 1
----> 1 P
NameError: name 'P' is not defined
In [145]:
Out[145]:
In [4]:
Out[4]:
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
Cell In[4], line 3
1 var('h')
2 H=lambda h:vector([Integer(1),h])
----> 3 EQ=(P(sl1(t),t)-H(h))*(P(sl1(t),t)-H(h))-(h-sl1(t))**Integer(2)
4 sol2=solve(EQ,h)
5 show(EQ)
NameError: name 'P' is not defined
In [52]:
Out[52]:
43.6028189727036
In [3]:
Out[3]:
-(rd - 1)^2 + x^2 + y^2
-1/4*(2*rd + 1)^2 + 1/4*(2*x - 1)^2 + y^2
(h - y)^2 - 1/4*(2*rd - 1)^2 + (x - 1)^2
In [222]:
Out[222]:
[
y == -2/3*sqrt(-2*x^2 + x + 1),
y == 2/3*sqrt(-2*x^2 + x + 1)
]
h^2 - 4/3*sqrt(-2*x^2 + x + 1)*h - 5/3*x + 17/12
In [220]:
Out[220]:
In [0]:
In [127]:
Out[127]:
In [129]:
In [132]:
Out[132]:
In [119]:
Out[119]:
[h == -2*(2*cos(1/180*pi*t)^2 + sin(1/180*pi*t)^2 - 4*cos(1/180*pi*t) + 2)/(cos(1/180*pi*t)^2 + 2*(cos(1/180*pi*t) - 3)*sin(1/180*pi*t) - 4*cos(1/180*pi*t) + 3)]
In [117]:
Out[117]:
[-0.122461193376488,
-0.497006953663421,
-1.14359353944898,
-2.09058526543021,
-3.36810188968151,
-5.00000000000000,
-6.99558882055134,
-9.34224391575730,
-12.0000000000000,
-14.8989856010991,
-17.9402334069727,
-21.0000000000000,
-23.9373053996508,
-26.6040074452375,
-28.8564064605510,
-30.5671708188125]
In [22]:
Out[22]:
In [36]:
Out[36]:
-1.11022302462516e-16
In [0]:
In [94]:
Out[94]:
In [0]:
In [87]:
Out[87]:
[x == -(sqrt(-x^2 + 1)*h - 2*h + sqrt(-7*h^2*x^2 + 11*h^2 - (7*h^2 + 2*h)*sqrt(-x^2 + 1) + 10*h + 4) - 4)/(sqrt(-x^2 + 1)*h + 2),
x == -(sqrt(-x^2 + 1)*h - 2*h - sqrt(-7*h^2*x^2 + 11*h^2 - (7*h^2 + 2*h)*sqrt(-x^2 + 1) + 10*h + 4) - 4)/(sqrt(-x^2 + 1)*h + 2)]
In [0]:
In [0]:
In [34]:
Out[34]:
3*cos(1/2*pi*t)^2 + 3*sin(1/2*pi*t)^2 - 3
In [0]:
In [0]:
In [7]:
In [4]:
In [7]:
Out[7]:
In [32]:
Out[32]:
3.53846153846154
In [3]:
In [20]:
Out[20]:
2
In [36]:
Out[36]:
3.41421356237309
In [32]:
Out[32]:
<bound method dpoly.perimeter of >
In [22]:
Out[22]:
4.00000000000000
In [0]:
In [82]:
Out[82]:
In [8]:
Out[8]:
In [0]:
In [55]:
In [85]:
Out[85]:
In [9]:
Out[9]:
Various useful bash commands in a jupiter worksheet:
!pwd to see the current directory.!ls to list the files in the current directory.
!grep 'class' 'file' to list the classes defined in file.
!grep 'class \|def' file to list the classes defined in file.
!ls --help to get a list of the options for ls. Works for grep too.
In [3]:
Out[3]:
2018-06-20-181627.zip
2018-11-03-175954.x11
2019-01-13-120733.sage
2020-03-07-191811.term
2020-08-13-163609.ipynb
2020-08-13-163609.sagews
2023-01-04-105231.ipynb
2023-02-07-132638.term
2023-03-30-232356.sagews
2024-04-17-190210.ipynb
2024-05-25-170940.ipynb
2024-06-02-122435.term
An_interesting_sagelet.sagews
Bicycles.html
Circumscribing_Ellipses.html
CnMd.ipynb
CnMd.sagews
MRCA_Howard2.html
Notebooks
Orthogonal_Trapezoids-1.html
Orthogonal_Trapezoids.html
Pappus.png
'Problem 4.sagews'
Problem_4.html
Projective_Geometry_with_Sagemath.html
Projective_Geometry_with_Sagemath.ipynb
QuadSpace-backup.html
QuadSpace.html
QuadSpace.pdf
QuadSpace.sagews
QuadSpace.tex
QuadSpace_graphs-backup.html
QuadSpace_graphs.html
QuadSpace_graphs.ipynb
QuadSpace_graphs.sage
QuadSpace_graphs2.ipynb
QuadSpacedefs.sage
Quadrisection.html
Question.html
'Showing discontinuities in 2d functions.sagews'
Symmetric_orthogonal_traps2.html
Tangential_quads.html
Trials
Untitled-checkpoint.ipynb
'algebraic trig functions and their derivatives.sagews'
april_try.sagews
bill.png
bn2.png
fibo.ipynb
file1.sage
file2.sage
graphs.sagews
heat_index.html
heat_index.ipynb
images
index.html
interpolation.sagews
levelngrad-bu.html
levelngrad2.html
matrix_factors.html
may_try.sagews
misc
newquad.html
newquad.ipynb
nonconvexsolution1.png
nonconvexsolution2.png
o3.png
o5.png
o7.png
o9.png
openapi_test.ipynb
orthog_experiments.sagews
orthog_experiments2.sagews
orthog_traps.html
orthogonal_traps.html
orthogtraps19.sage
pappus.ipynb
pappus1.html
parallelograms.html
pde_plots.html
plot_tensor.ipynb
projective_geom.ipynb
projective_geom.pdf
projective_geom.sagews
projective_geom_27_0.png
projective_geom_4_0.png
projective_geom_7_1.png
projective_geom_8_1.png
quad_index.html
quadapps12_23.sage
quaddefs.sage
quadrilateral_prob.html
quadrisection20.sage
quadtri-1.html
rational_trig
sagecellblank.html
sagelets.sage
space_of_quads.pdf
stuff
sudoku.ipynb
sudoku.sagews
symmetric_abc.html
symotrap.sage
symotrap2.sage
template.html
test-no-output.ipynb
test.ipynb
testing.html
testquad.html
testquad.ipynb
testquadapps12_23.ipynb
tmp1.sage
tmp2.sage
trapezoid_experiments.html
twitter_probs
uksagelets
unihyper.ipynb
unit_circle.ipynb
In [7]:
Out[7]:
class elip(object):
def __init__(self,h=0,k=0,a=2,b=1):
class elip2(object):
def __init__(self,h=0,k=0,a=2,b=1):
︡e93af470-3a3c-42a1-b361-53bf55b441ff︡{"stderr":"Error in lines 1-1\nTraceback (most recent call last):\n File \"/cocalc/lib/python2.7/site-packages/smc_sagews/sage_server.py\", line 1191, in execute\n flags=compile_flags), namespace, locals)\n File \"\", line 1, in <module>\nNameError: name 'self' is not defined\n"}︡{"done":true}
︡9b984208-1792-470c-b134-3ff214ebb796︡{"stderr":"Error in lines 1-1\nTraceback (most recent call last):\n File \"/cocalc/lib/python2.7/site-packages/smc_sagews/sage_server.py\", line 1191, in execute\n flags=compile_flags), namespace, locals)\n File \"\", line 1, in <module>\nNameError: name 'self' is not defined\n"}︡{"done":true}
def doit(v=input_grid(1, 4, default=[0,0,2,1], label='$[h_1,k_1,r_1,b_1]$'),u=input_grid(1, 3,default=[[2,3,1]], label='$[h_2,k_2,r_2]$',to_value=lambda x:flatten(x)),th=input_box(45,width=6,label='$\\alpha$'), th1=input_box(180,width=6,label='$\\theta$'),movie=checkbox(false),auto_update=true):
def f(X=[1,5,1]):
def g(X=[1,5,1]):
def f1(X=[1,5]):
def g1(X=[1,5]):
class hyper_traps(object):
def __init__(self,H1=[(0,2),(0,0),60],H2=[(1,1),(-.5,1),80]):
class hyperold(object):
def __init__(self,Inpts=[[(-1,0),(1,0)],60,70]):
class hyper(object):
def __init__(self,Inpts=[[(-1,0),(1,0)],60,70]):
class hypgorth_trap(object):
def __init__(self,AC1=[(1,0),(-1,0)],AC2=[(0,.8),(0,-1)],alp1=30,bet1=90,thet1=5,alp2=50, bet2=70, bp=[0,0]):
class dpoly(object):
def __init__(self,size,decimal=true):
def __repr__(self):
def fit(self,P,Q):
def opvert(self,k,Q):
def getvops(self,Q):
def perpvert(self,k,Q):
def perpvert(self,k,Q):
def get_perp(self,P,Q,T):
def perpvert(self,k,Q):
def getperps(self,Q):
def get_all(self,verts):
def getpol(self,X,A,B):
class cpoly8(object):
def __init__(self,h,numtraps=0,frs=12,L=[0,0],Rt=([0,0],0)):
def AR(t):
def upcls(eps=.5,cen=P2):
class angtrap8(object):
def __init__(self,A1=[2,0],C1=[-1,0],alp=80,bet=50,thet=20,trns=[0,0],mode=0):
def s(t):
def ds(t):
def Alp(t):
class angorth8_trap(object):
def __init__(self,A1=[1,0],C1=[-.9,0],A2=[0,.8],C2=[0,-.85],alp1=30,bet1=90,thet1=30,alp2=120,bet2=60,trs=[0,0]):
class quadra(object):
def __init__(self,pol=[(0,0),(8,0),(12,3),(8,6)]):
def edgy(n=0,colr='gray'):
def arcy(n=0,colr='gray'):
class hyper2(object):
def __init__(self,Inpts=[[(-1,0),(1,0)],60,70]):
class hyp2gorth_trap(object):
def __init__(self,AC1=[(1,0),(-1,0)],AC2=[(0,.8),(0,-1)],alp1=30,bet1=90,thet1=5,alp2=50, bet2=70, bp=[0,0]):
class hyptrap(object):
def __init__(self,A1=[2,0],C1=[-1,0],alp=80,bet=100,thet=20,trns=[0,0],mode=0):
def s(t):
def ds(t):
def Alp(t):
In [0]:
In [68]:
In [0]:
In [60]:
Out[60]:
def meps(n=10^2):
"""meps(n=10^2) returns n*(machine epsilon)"""
def betw(A,B,X,Y):
def chkcon(pol):
"""returns true if pol is a convex polygon oriented counterclockwise."""
def Refll(Pol=[[0,0],[1,0],[1,3]],ln=[[0,0],[1,0]]):
"""Refll(Pol=[[0,0],[1,0],[1,3]],ln=[[0,0],[1,0]]) returns the reflection of Pol about the line ln"""
def Rot(Pol=[[0,0],[1,0],[1,3]],cen=[0,0],th=30,deg=true,dec=true):
"""Rot(Pol=[[0,0],[1,0],[1,3]],cen=[0,0],th=30,deg=true) returns the rotation of Pol by th degrees about cen."""
def Trans(Pol=[[0,0],[1,0],[1,3]],v=[1,2]):
"""Trans(Pol=[[0,0],[1,0],[1,3]],v=[1,2]) returns the list [p+v for p in Pol]. That is, it translates the polygon by v."""
def Roll(Pol=[[0,0],[1,0],[1,3]],num=1,left=true):
"""Roll(Pol=[[0,0],[1,0],[1,3]],num=1,left=true) return the list rolled to the left num times"""
def area(A,B,C):
"""area(A,B,C) returns the area of the triangle with vertices A, B, and C."""
def polarea(P,warn=false):
"""polarea(P) returns (a, ars) where a is the area of the polygon with vertices P (a list of ordered pairs),
That is, triangles P[0] P[i] P[i+1] and P[0] P[i+1] P[i+2] have disjoint interiors."""
def Refll(Pol=[[0,0],[1,0],[1,3]],ln=[[0,0],[1,0]]):
"""Refll(Pol=[[0,0],[1,0],[1,3]],ln=[[0,0],[1,0]]) returns the reflection of Pol about the line ln"""
def intsct(*args):
"""intsct(A,An,B,Bn) returns the point of intersection of the segments AAn and BBn"""
def proj(u,v):
def offset(eps,dl):
def ang(u,v,deg=true,dec=true):
"""return the angle between the vectors u and v, measured counterclockwise in degrees."""
def dir(th,degs=true):
"""returns the direction [cos(th),sin(th)]"""
def getang(v=[-2,.10],degs=true,dec=true,clkws=false):
"""if v is a vector, returns the angle the vector v makes with the positive x-axis in decimal degrees measured counterclockwise.
if v is a list [A,B,C] of points, returns the angle ABC in degrees measured counterclockwise."""
def getdir(A=[1,0],B=[2,-1],th=-20,degs=true,dec=true):
"""Returns the direction from A towards B rotated th degrees counterclockwise if th > 0, rotated clockwise otherwise."""
class cpoly5(object):
"""c=cpoly5(h,frs=6) takes h, a dpoly object and creates a cpoly5 object with lots of attributes, the most important one of which is
c.trap a list of the angorth2_trap objects constructed from h."""
def __init__(self,h,frs=12,L=[0,0],Rt=([0,0],0)):
def upcls(eps=.5,cen=P2):
def toreal(x):
def concyclic(m=3,lst=[]):
"""concyclic(n) returns the the vertices P of the regular n-gon centered at (0,0) listed counterclockwise starting at P[0]=(1,0)"""
class Xm(object):
def __init__(self,m=1,n=1,mode=0):
def info():
class XM(object):
def __init__(self,m=1,n=1,mode=0):
def info():
def upcls(pic,cen=[0,0],ep=1,axes=false,bord=false):
def view(pic,ep=.1,cen=[0,0],axes=true,win=false,bord=false,figsize=''):
class angtrap4(object):
def __init__(self,A1=[2,0],C1=[-1,0],alp=80,bet=50,thet=20,trns=[0,0],mode=0):
def s(t):
def ds(t):
def Alp(t):
class angorth5_trap(object):
def __init__(self,A1=[1,0],C1=[-.9,0],A2=[0,.8],C2=[0,-.85],alp1=30,bet1=90,thet1=30,alp2=120,bet2=60,trs=[0,0]):
def chk():
def chk_view(eps=.5,t0=.9,dt=.05,sz=15,fz=10):
def info():
def Unit(ang=45,deg=true):
def getsym2_trap(A1=[1,0],C1=[-1,0],alp1=100,bet1=60,thet1=29,rp=1/2,up=true):
In [0]:
In [15]:
Out[15]:
2018-06-20-181627.zip
2018-11-03-175954.x11
2019-01-13-120733.sage
2020-03-07-191811.term
2020-08-13-163609.ipynb
2020-08-13-163609.sagews
2023-01-04-105231.ipynb
2023-02-07-132638.term
2023-03-30-232356.sagews
2024-04-17-190210.ipynb
2024-05-25-170940.ipynb
2024-06-02-122435.term
An_interesting_sagelet.sagews
Bicycles.html
Circumscribing_Ellipses.html
CnMd.ipynb
CnMd.sagews
MRCA_Howard2.html
Notebooks
Orthogonal_Trapezoids-1.html
Orthogonal_Trapezoids.html
Pappus.png
'Problem 4.sagews'
Problem_4.html
Projective_Geometry_with_Sagemath.html
Projective_Geometry_with_Sagemath.ipynb
QuadSpace-backup.html
QuadSpace.html
QuadSpace.pdf
QuadSpace.sagews
QuadSpace.tex
QuadSpace_graphs-backup.html
QuadSpace_graphs.html
QuadSpace_graphs.ipynb
QuadSpace_graphs.sage
QuadSpace_graphs2.ipynb
QuadSpacedefs.sage
Quadrisection.html
Question.html
'Showing discontinuities in 2d functions.sagews'
Symmetric_orthogonal_traps2.html
Tangential_quads.html
Trials
Untitled-checkpoint.ipynb
'algebraic trig functions and their derivatives.sagews'
april_try.sagews
bill.png
bn2.png
fibo.ipynb
file1.sage
file2.sage
graphs.sagews
heat_index.html
heat_index.ipynb
images
index.html
interpolation.sagews
levelngrad-bu.html
levelngrad2.html
matrix_factors.html
may_try.sagews
misc
newquad.html
newquad.ipynb
nonconvexsolution1.png
nonconvexsolution2.png
o3.png
o5.png
o7.png
o9.png
openapi_test.ipynb
orthog_experiments.sagews
orthog_experiments2.sagews
orthog_traps.html
orthogonal_traps.html
orthogtraps19.sage
pappus.ipynb
pappus1.html
parallelograms.html
pde_plots.html
plot_tensor.ipynb
projective_geom.ipynb
projective_geom.pdf
projective_geom.sagews
projective_geom_27_0.png
projective_geom_4_0.png
projective_geom_7_1.png
projective_geom_8_1.png
quad_index.html
quadapps12_23.sage
quaddefs.sage
quadrilateral_prob.html
quadrisection20.sage
quadtri-1.html
rational_trig
sagecellblank.html
sagelets.sage
space_of_quads.pdf
stuff
sudoku.ipynb
sudoku.sagews
symmetric_abc.html
symotrap.sage
symotrap2.sage
template.html
test-no-output.ipynb
test.ipynb
testing.html
testquad.html
testquad.ipynb
testquadapps12_23.ipynb
tmp1.sage
tmp2.sage
trapezoid_experiments.html
twitter_probs
uksagelets
unihyper.ipynb
unit_circle.ipynb
In [8]:
In [6]:
Out[6]:
2018-06-20-181627.zip
2018-11-03-175954.x11
2019-01-13-120733.sage
2020-03-07-191811.term
2020-08-13-163609.ipynb
2020-08-13-163609.sagews
2023-01-04-105231.ipynb
2023-02-07-132638.term
2023-03-30-232356.sagews
2024-04-17-190210.ipynb
2024-05-25-170940.ipynb
2024-06-02-122435.term
An_interesting_sagelet.sagews
Bicycles.html
Circumscribing_Ellipses.html
CnMd.ipynb
CnMd.sagews
MRCA_Howard2.html
Notebooks
Orthogonal_Trapezoids-1.html
Orthogonal_Trapezoids.html
Pappus.png
'Problem 4.sagews'
Problem_4.html
Projective_Geometry_with_Sagemath.html
Projective_Geometry_with_Sagemath.ipynb
QuadSpace-backup.html
QuadSpace.html
QuadSpace.pdf
QuadSpace.sagews
QuadSpace.tex
QuadSpace_graphs-backup.html
QuadSpace_graphs.html
QuadSpace_graphs.ipynb
QuadSpace_graphs.sage
QuadSpace_graphs2.ipynb
QuadSpacedefs.sage
Quadrisection.html
Question.html
'Showing discontinuities in 2d functions.sagews'
Symmetric_orthogonal_traps2.html
Tangential_quads.html
Trials
Untitled-checkpoint.ipynb
'algebraic trig functions and their derivatives.sagews'
april_try.sagews
bill.png
bn2.png
fibo.ipynb
file1.sage
file2.sage
graphs.sagews
heat_index.html
heat_index.ipynb
images
index.html
interpolation.sagews
levelngrad-bu.html
levelngrad2.html
matrix_factors.html
may_try.sagews
misc
newquad.html
newquad.ipynb
nonconvexsolution1.png
nonconvexsolution2.png
o3.png
o5.png
o7.png
o9.png
openapi_test.ipynb
orthog_experiments.sagews
orthog_experiments2.sagews
orthog_traps.html
orthogonal_traps.html
orthogtraps19.sage
pappus.ipynb
pappus1.html
parallelograms.html
pde_plots.html
plot_tensor.ipynb
projective_geom.ipynb
projective_geom.pdf
projective_geom.sagews
projective_geom_27_0.png
projective_geom_4_0.png
projective_geom_7_1.png
projective_geom_8_1.png
quad_index.html
quadapps12_23.sage
quaddefs.sage
quadrilateral_prob.html
quadrisection20.sage
quadtri-1.html
rational_trig
sagecellblank.html
sagelets.sage
space_of_quads.pdf
sudoku.ipynb
sudoku.sagews
symmetric_abc.html
symotrap.sage
symotrap2.sage
template.html
test-no-output.ipynb
test.ipynb
testing.html
testquad.html
testquad.ipynb
testquadapps12_23.ipynb
tmp1.sage
tmp2.sage
trapezoid_experiments.html
twitter_probs
uksagelets
unihyper.ipynb
unit_circle.ipynb
In [0]:
In [19]:
Out[19]:
/home/user/sagelets/Trials/Brilliant_November_Problem.sagews:50:def prob(n=30,ns=1,s=.1):
/home/user/sagelets/Trials/Brilliant_November_Problem.sagews:73:def prob(n=30,ns=1,s=.1):
/home/user/sagelets/Trials/Brilliant_November_Problem.sagews:77:def maxprob(n=30,rng=[1,3],s=.1):
/home/user/sagelets/Trials/Brilliant_November_Problem.sagews:90:def _(n=input_box(default=30,width=10),c=input_box(default=3,width=10),p=input_box(default=1/10,width=10),auto_update=false):
/home/user/sagelets/Trials/Brilliant_November_Problem.sagews:102:︡07c16dcb-c52e-4adb-921a-b0458308821a︡{"done":true,"md":"# STARTPROB\n\ndef prob(n=30,ns=1,s=.1):\n \"\"\"prob(n,ns,s) returns the probability of exactly ns successes in n trials if the probability of success is s.\"\"\"\n return binomial(n,ns)*s^ns*(1-s)^(n-ns)\n\ndef maxprob(n=30,rng=[1,3],s=.1):\n sp=[0,0]\n rng=range(rng[0],rng[1]+1)\n if n<rng[-1]:\n return 1\n for k in range(rng[0],n+1):\n spn=sum([prob(k,i,s) for i in rng])\n if spn<sp[1]:\n return sp\n else:\n sp=(k,spn)\n return sp\n@interact(layout=dict(top=[['n','c','p']]))\ndef _(n=input_box(default=30,width=10),c=input_box(default=3,width=10),p=input_box(default=1/10,width=10),auto_update=false):\n if c==0:\n show('c needs to be between 1 and n.')\n return\n ans=maxprob(n,[1,c],p)\n stg='If '+str(n)+' people are invited to a party and the probability of a person bringing a can of cranberries is '+str(p.n(digits=5))+' if asked,\\n'\n stg+='then how many people should be asked to maximize the probability that at least 1 and no more than '+str(c)+' cans will be brought?\\n'\n answer='Answer: Ask '+str(ans[0])+' people for a maximum probability of '+str(ans[1].n(digits=5))+'.'\n print(stg)\n show(answer)\n\n#ENDPROB"}
/home/user/sagelets/Trials/Brilliant_November_Problem.sagews:104:def prob(n=30,ns=1,s=.1):
/home/user/sagelets/Trials/Brilliant_November_Problem.sagews:108:def maxprob(n=30,rng=[1,3],s=.1):
/home/user/sagelets/Trials/PopularMechanicsProblem.sagews:65:def pol(u=-8,v=13,clr='black',symbol=false):
/home/user/sagelets/Trials/PopularMechanicsProblem.sagews:130:def pol(u=-8,v=13,clr='black',symbol=false):
/home/user/sagelets/Trials/PopularMechanicsProblem.sagews:213:def pol(u=-8,v=13,clr='black',symbol=false):
/home/user/sagelets/Trials/PopularMechanicsProblem.sagews:224:def _(t1=input_box(30,width=10),auto_update=false):
/home/user/sagelets/Trials/PopularMechanicsProblem.sagews:279:def pol(u=-8,v=13,t1=30,b=10,clr='black',symbol=false):
/home/user/sagelets/Trials/PopularMechanicsProblem.sagews:348:def pol(u=-8,v=13,b=10,clr='black',symbol=false):
/home/user/sagelets/Trials/PopularMechanicsProblem.sagews:360:def _(b=input_box(10,width=10),t1=input_box(30,width=10),auto_update=false):
/home/user/sagelets/Trials/Regular.sagews:95:def reglr(n=5,rot=0,clr='black'):
/home/user/sagelets/Trials/Regular.sagews:101:def comm(crd=[6,9],rot=0,clr=['blue','red','green','black','turquoise','magenta'] ):
/home/user/sagelets/Trials/Regular.sagews:129:def comm(crd=[6,9],rot=[0,0],clr=['blue','red','green','black','turquoise','magenta'] ):
/home/user/sagelets/Trials/Regular.sagews:170:def cs
/home/user/sagelets/Trials/Regular.sagews:224:def reglr(n=5,rot=0,clr='black'):
/home/user/sagelets/Trials/Regular.sagews:230:def comm(crd=[6,9],rot=0,clr=['blue','red','green','black','turquoise','magenta'] ):
/home/user/sagelets/Trials/Regular.sagews:258:def cscale(ps=[3,5],rot=2/3,clr=['blue','red','green','black','turquoise','magenta']):
/home/user/sagelets/Trials/Regular.sagews:277:def _(crd=input_box(default=[6,9,12,10],width=30),rot=input_box(default=2/3,width=20),auto_update=false):
/home/user/sagelets/Trials/Regular.sagews:288:def reglr(n=5,clr='black',ang=0,fill=False):
/home/user/sagelets/Trials/Regular.sagews:292:def comm(crd=[6,9],clr=['blue','red','green','black','turquoise'],angs=[0,0,0],fill=False):
/home/user/sagelets/Trials/Smullyan_puzzles.sagews:53:def stateprob(a=10,b=7):
/home/user/sagelets/Trials/Smullyan_puzzles.sagews:56:def answer(a=10,b=7):
/home/user/sagelets/Trials/Smullyan_puzzles.sagews:61:def sol():
/home/user/sagelets/Trials/Smullyan_puzzles.sagews:65:def __(a=input_box(default=10,width=10),b=input_box(default=7,width=10),answer=input_box(width=10),solution=false,auto_update=false):
/home/user/sagelets/Trials/Smullyan_puzzles.sagews:100:def stateprob(b=56,p=10,d=6,c=5):
/home/user/sagelets/Trials/Smullyan_puzzles.sagews:103:def answer(b=56,p=10,d=6,c=5):
/home/user/sagelets/Trials/Smullyan_puzzles.sagews:106:def sol():
/home/user/sagelets/Trials/Smullyan_puzzles.sagews:111:def __(b=input_box(default=56,width=10),p=input_box(default=10,width=10), d=input_box(default=6, width=10),c=input_box(default=5,width=10), dogs=input_box(width=10), cats=input_box(width=10), solution=false,auto_update=false):
/home/user/sagelets/Trials/Smullyan_puzzles.sagews:164:def lst2num(input=[2,3,4]):
/home/user/sagelets/Trials/Smullyan_puzzles.sagews:170:def strip3s(lst=[3,3,3,3,2]):
/home/user/sagelets/Trials/Smullyan_puzzles.sagews:181:def curious(input=405):
/home/user/sagelets/Trials/Smullyan_puzzles.sagews:211:def _(input=input_box(default=326785,width=40)):
/home/user/sagelets/Trials/Smullyan_puzzles.sagews:247:def lst2num(input=[2,3,4]):
/home/user/sagelets/Trials/Smullyan_puzzles.sagews:253:def strip3s(lst=[3,3,3,3,2]):
/home/user/sagelets/Trials/Smullyan_puzzles.sagews:264:def curious(input=405):
/home/user/sagelets/Trials/Smullyan_puzzles.sagews:294:def _(input=input_box(default=326785,width=40)):
/home/user/sagelets/Trials/Smullyan_puzzles.sagews:313:def lst2num(input=[2,3,4]):
/home/user/sagelets/Trials/Smullyan_puzzles.sagews:319:def strip3s(lst=[3,3,3,3,2]):
/home/user/sagelets/Trials/Smullyan_puzzles.sagews:330:def curious(input=405):
/home/user/sagelets/Trials/activate-1.sagews:151:def set_axes_labels(graph, xlabel, ylabel, zlabel,minpt=true, **kwds):
/home/user/sagelets/Trials/activate-1.sagews:197:def _(t3=input_box(default=6/10,width=10),b1=input_box(default=3/10,width=10),c1=input_box(default=9/10,width=10),d1=input_box(default=1/4,width=10),e1=input_box(default=1/2,width=10)):
/home/user/sagelets/Trials/testing-1.sagews:113:def game(p=[.8,.15,.05],pv=[1,3,10],ns=[8,6]):
/home/user/sagelets/Trials/testing-1.sagews:129:def trials(p=[.8,.15,.05],pv=[1,3,10],ns=[8,3],nt=100):
/home/user/sagelets/Trials/testing-1.sagews:141:def expval(p=[.8,.15,.05],v=[1,3,10],ns=[4,4]):
/home/user/sagelets/Trials/testing-1.sagews:147:def tabval(p=[.7,.25,.05],v=[1,3,10],n=8):
/home/user/sagelets/Trials/testing-1.sagews:163:def _(p=input_box(default=[8/10,3/20,1/20],width=30),pv=input_box(default=[1,3,10],width=20),ns=input_box(default=8,width=8), ntrl=input_box(default=1000,width=10)):
/home/user/sagelets/Trials/testing-1.sagews:197:def game(p=[.8,.15,.05],pv=[1,3,10],ns=[8,6]):
/home/user/sagelets/Trials/testing-1.sagews:214:def trials(p=[.8,.15,.05],pv=[1,3,10],ns=[8,3],nt=100):
/home/user/sagelets/Trials/testing-1.sagews:228:def expval(p=[.8,.15,.05],v=[1,3,10],ns=[4,4]):
/home/user/sagelets/Trials/testing-1.sagews:234:def tabval(p=[.7,.25,.05],v=[1,3,10],n=8):
/home/user/sagelets/Trials/testing-1.sagews:262:def game(p=[.8,.15,.05],pv=[1,3,10],ns=[8,6]):
/home/user/sagelets/Trials/testing-1.sagews:278:def trials(p=[.8,.15,.05],pv=[1,3,10],ns=[8,3],nt=100):
/home/user/sagelets/Trials/testing-1.sagews:291:def expval(p=[.8,.15,.05],v=[1,3,10],ns=[4,4]):
/home/user/sagelets/Trials/testing-1.sagews:297:def tabval(p=[.7,.25,.05],v=[1,3,10],n=8):
/home/user/sagelets/Trials/testing-1.sagews:361:def maxv(p=[.8,.15,.05],v=[1,3,10],n=10):
/home/user/sagelets/Trials/testing-1.sagews:393:def f():
/home/user/sagelets/Trials/testing-1.sagews:419:def game2(p=[.8,.15,.05],pv=[1,3,10],ns=[10,6]):
/home/user/sagelets/Trials/testing-1.sagews:456:def trials2(p=[.05,.15,.8],pv=[10,3,1],ns=[8,4],nt=100):
/home/user/sagelets/Trials/testing.sagews:113:def game(p=[.8,.15,.05],pv=[1,3,10],ns=[8,6]):
/home/user/sagelets/Trials/testing.sagews:129:def trials(p=[.8,.15,.05],pv=[1,3,10],ns=[8,3],nt=100):
/home/user/sagelets/Trials/testing.sagews:141:def expval(p=[.8,.15,.05],v=[1,3,10],ns=[4,4]):
/home/user/sagelets/Trials/testing.sagews:147:def tabval(p=[.7,.25,.05],v=[1,3,10],n=8):
/home/user/sagelets/Trials/testing.sagews:163:def _(p=input_box(default=[8/10,3/20,1/20],width=30),pv=input_box(default=[1,3,10],width=20),ns=input_box(default=8,width=8), ntrl=input_box(default=1000,width=10)):
/home/user/sagelets/Trials/testing.sagews:197:def game(p=[.8,.15,.05],pv=[1,3,10],ns=[8,6]):
/home/user/sagelets/Trials/testing.sagews:214:def trials(p=[.8,.15,.05],pv=[1,3,10],ns=[8,3],nt=100):
/home/user/sagelets/Trials/testing.sagews:228:def expval(p=[.8,.15,.05],v=[1,3,10],ns=[4,4]):
/home/user/sagelets/Trials/testing.sagews:234:def tabval(p=[.7,.25,.05],v=[1,3,10],n=8):
/home/user/sagelets/Trials/testing.sagews:262:def game(p=[.8,.15,.05],pv=[1,3,10],ns=[8,6]):
/home/user/sagelets/Trials/testing.sagews:278:def trials(p=[.8,.15,.05],pv=[1,3,10],ns=[8,3],nt=100):
/home/user/sagelets/Trials/testing.sagews:291:def expval(p=[.8,.15,.05],v=[1,3,10],ns=[4,4]):
/home/user/sagelets/Trials/testing.sagews:297:def tabval(p=[.7,.25,.05],v=[1,3,10],n=8):
/home/user/sagelets/Trials/testing.sagews:361:def maxv(p=[.8,.15,.05],v=[1,3,10],n=10):
/home/user/sagelets/Trials/testing.sagews:393:def f():
/home/user/sagelets/Trials/testing.sagews:419:def game2(p=[.8,.15,.05],pv=[1,3,10],ns=[10,6]):
/home/user/sagelets/Trials/testing.sagews:456:def trials2(p=[.05,.15,.8],pv=[10,3,1],ns=[8,4],nt=100):
In [16]:
Out[16]:
Usage: grep [OPTION]... PATTERNS [FILE]...
Search for PATTERNS in each FILE.
Example: grep -i 'hello world' menu.h main.c
PATTERNS can contain multiple patterns separated by newlines.
Pattern selection and interpretation:
-E, --extended-regexp PATTERNS are extended regular expressions
-F, --fixed-strings PATTERNS are strings
-G, --basic-regexp PATTERNS are basic regular expressions
-P, --perl-regexp PATTERNS are Perl regular expressions
-e, --regexp=PATTERNS use PATTERNS for matching
-f, --file=FILE take PATTERNS from FILE
-i, --ignore-case ignore case distinctions in patterns and data
--no-ignore-case do not ignore case distinctions (default)
-w, --word-regexp match only whole words
-x, --line-regexp match only whole lines
-z, --null-data a data line ends in 0 byte, not newline
Miscellaneous:
-s, --no-messages suppress error messages
-v, --invert-match select non-matching lines
-V, --version display version information and exit
--help display this help text and exit
Output control:
-m, --max-count=NUM stop after NUM selected lines
-b, --byte-offset print the byte offset with output lines
-n, --line-number print line number with output lines
--line-buffered flush output on every line
-H, --with-filename print file name with output lines
-h, --no-filename suppress the file name prefix on output
--label=LABEL use LABEL as the standard input file name prefix
-o, --only-matching show only nonempty parts of lines that match
-q, --quiet, --silent suppress all normal output
--binary-files=TYPE assume that binary files are TYPE;
TYPE is 'binary', 'text', or 'without-match'
-a, --text equivalent to --binary-files=text
-I equivalent to --binary-files=without-match
-d, --directories=ACTION how to handle directories;
ACTION is 'read', 'recurse', or 'skip'
-D, --devices=ACTION how to handle devices, FIFOs and sockets;
ACTION is 'read' or 'skip'
-r, --recursive like --directories=recurse
-R, --dereference-recursive likewise, but follow all symlinks
--include=GLOB search only files that match GLOB (a file pattern)
--exclude=GLOB skip files that match GLOB
--exclude-from=FILE skip files that match any file pattern from FILE
--exclude-dir=GLOB skip directories that match GLOB
-L, --files-without-match print only names of FILEs with no selected lines
-l, --files-with-matches print only names of FILEs with selected lines
-c, --count print only a count of selected lines per FILE
-T, --initial-tab make tabs line up (if needed)
-Z, --null print 0 byte after FILE name
Context control:
-B, --before-context=NUM print NUM lines of leading context
-A, --after-context=NUM print NUM lines of trailing context
-C, --context=NUM print NUM lines of output context
-NUM same as --context=NUM
--group-separator=SEP print SEP on line between matches with context
--no-group-separator do not print separator for matches with context
--color[=WHEN],
--colour[=WHEN] use markers to highlight the matching strings;
WHEN is 'always', 'never', or 'auto'
-U, --binary do not strip CR characters at EOL (MSDOS/Windows)
When FILE is '-', read standard input. With no FILE, read '.' if
recursive, '-' otherwise. With fewer than two FILEs, assume -h.
Exit status is 0 if any line is selected, 1 otherwise;
if any error occurs and -q is not given, the exit status is 2.
Report bugs to: [email protected]
GNU grep home page: <https://www.gnu.org/software/grep/>
General help using GNU software: <https://www.gnu.org/gethelp/>
In [0]:
In [87]:
Out[87]:
In [12]:
Out[12]:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[12], line 16
14 var('x, y')
15 expr = sqrt(Integer(2))*x + pi*y + e
---> 16 rounded_expr = round_constants(expr)
17 print(expr)
18 print(rounded_expr)
Cell In[12], line 11, in round_constants(expr, digits)
1 def round_constants(expr, digits=Integer(4)):
2 """Rounds constants in a symbolic expression to a specified number of decimal digits.
3
4 Args:
(...)
9 The expression with constants rounded.
10 """
---> 11 return expr.n(digits=digits)
File /ext/sage/10.6/src/sage/structure/element.pyx:903
, in sage.structure.element.Element.n()
901 0.666666666666667
902 """
--> 903 return self.numerical_approx(prec, digits, algorithm)
904
905 def _mpmath_(self, prec=53, rounding=None):
File /ext/sage/10.6/src/sage/symbolic/expression.pyx:6674
, in sage.symbolic.expression.Expression.numerical_approx()
6672 res = x.pyobject()
6673 else:
-> 6674 raise TypeError("cannot evaluate symbolic expression numerically")
6675
6676 # Important -- the we get might not be a valid output for numerical_approx in
TypeError: cannot evaluate symbolic expression numerically
In [0]:
In [11]:
Out[11]:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[11], line 3
1 var('x y')
2 expr=Integer(1)/RealNumber('3.')*x+sin(y/RealNumber('7.'))-y/RealNumber('10.')**(-Integer(17))
----> 3 show(expr.n(digits=Integer(4)))
File /ext/sage/10.6/src/sage/structure/element.pyx:903
, in sage.structure.element.Element.n()
901 0.666666666666667
902 """
--> 903 return self.numerical_approx(prec, digits, algorithm)
904
905 def _mpmath_(self, prec=53, rounding=None):
File /ext/sage/10.6/src/sage/symbolic/expression.pyx:6674
, in sage.symbolic.expression.Expression.numerical_approx()
6672 res = x.pyobject()
6673 else:
-> 6674 raise TypeError("cannot evaluate symbolic expression numerically")
6675
6676 # Important -- the we get might not be a valid output for numerical_approx in
TypeError: cannot evaluate symbolic expression numerically
In [0]:
In [7]:
In [9]:
Out[9]:
-1.0 -1.0 -1.0
Graphics3d Object
In [4]:
In [1]:
Out[1]:
hi
In [1]:
Out[1]:
-2*b*t3*x + 2*c*t3*x - 3*d*t3*x + 3*e*t3*x - 2*c*t3 + 3*d*t3 + 2*b*x - 2*c*x + 2*c
In [0]:
In [24]:
Out[24]:
[[[ 2 4 6]
[ 8 10 12]
[14 16 18]]
[[22 24 26]
[28 30 32]
[34 36 38]]
[[42 44 46]
[48 50 52]
[54 56 58]]]
In [2]:
Out[2]:
[[3 4]
[6 8]]
In [4]:
Out[4]:
/ext/sage/10.3/local/var/lib/sage/venv-python3.11.1/lib/python3.11/site-packages/scikits/__init__.py:1: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
__import__("pkg_resources").declare_namespace(__name__)
/ext/sage/10.3/local/var/lib/sage/venv-python3.11.1/lib/python3.11/site-packages/scikits/__init__.py:1: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('scikits')`.
Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
__import__("pkg_resources").declare_namespace(__name__)
In [35]:
In [36]:
Out[36]:
In [24]:
Out[24]:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[24], line 1
----> 1 apf=tly.decomposition.CP.fit(a)
2 show(apf[Integer(0)],apf[Integer(1)])
TypeError: DecompositionMixin.fit() missing 1 required positional argument: 'tensor'
In [5]:
Out[5]:
In [16]:
Out[16]:
3
In [49]:
In [50]:
Out[50]:
trap 0
rt0 = 0
rt1 = 0.3333333332593333
In [9]:
In [60]:
Out[60]:
In [18]:
Out[18]:
In [3]:
Out[3]:
(81.8526016111049, 0.491876458806038, 0.491876458806038, 1.52651314801874)
In [1]:
In [20]:
In [30]:
Out[30]:
[(0.000000000000000, 0.800000000000000),
(-0.591887121551798, 1.14172618895780),
(0.000000000000000, -0.850000000000000),
(0.418527397346263, -0.608363094478902)]
In [31]:
Out[31]:
[(1, 0),
(0.443502884254440, 0.321293759578949),
(-0.900000000000000, 0.000000000000000),
(-0.900000000000000, -0.454377992302390)]
In [101]:
In [22]:
Out[22]:
Help on function poly4 in module __main__:
poly4(t1, t2, t3, t4, A=(1, 0), C=(-1, 0), labels=False, model=True)
returns the quadrilateral ABCD defined by the parameters t1 t2 t3 t4.
In [5]:
Out[5]:
In [43]:
Out[43]:
(-0.900000000000000, -0.454377992302390)
In [36]:
Out[36]:
Help on function window in module __main__:
window(L=0, U=0, ep=0.100000000000000, sz=0, cen=(0, 0), figsize=5, color='blue', alpha=0, axes=False, aspect_ratio=1)
In [32]:
In [48]:
Out[48]:
In [0]:
In [13]:
Out[13]:
[0.4873949580, 0.9094733512, 1.000000000, 0.2436974790]
In [6]:
Out[6]:
Manual interactive function <function _ at 0x7f73b8e17740> with 3 widgets
parms: EvalText(value='[1, 1, 1, 1…
In [2]:
Out[2]:
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
Cell In[2], line 1
----> 1 pic.show(title='bill was here')
NameError: name 'pic' is not defined
In [18]:
In [20]:
Out[20]:
In [0]:
In [227]:
In [244]:
In [208]:
In [213]:
Out[213]:
0.9922011152869369424814976667934448505*x^2 + (4.014623336809837343425993029288696660772513783868e-50)*(5.53322086527351939533095e24*y + 4.4075154954283119820116e23)^2 - 1.00000000000000
In [231]:
In [0]:
In [0]:
In [246]:
Out[246]:
middle quadrilateral, dimension 4
trap 0
rt1 = 0.17968012009352616
trap 1
done
trap 2
done
trap 3
done
In [0]:
In [158]:
Out[158]:
In [166]:
Out[166]:
In [163]:
Out[163]:
In [44]:
Out[44]:
In [0]:
In [0]:
In [93]:
In [141]:
Out[141]:
In [62]:
In [53]:
Out[53]:
1
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [8]:
Out[8]:
[(1.00000000000000, 0.000000000000000),
(0.309016994374947, 0.951056516295154),
(-0.809016994374947, 0.587785252292473),
(-0.809016994374948, -0.587785252292473),
(0.309016994374947, -0.951056516295154)]
In [0]:
In [0]:
In [0]:
In [35]:
Out[35]:
(8.00000, 0.0200000)
In [0]:
In [0]:
In [0]:
In [0]:
In [32]:
In [37]:
Out[37]:
143948740534.56198
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [7]:
Out[7]:
2025
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [0]:
In [5]:
Out[5]:
4096
In [4]:
Out[4]:
72*sqrt(5) + 161
In [0]:
In [17]:
Out[17]:
5.19180654857877
In [21]:
Out[21]:
5.39492056215378
In [2]:
Out[2]:
(h - x)^2/a^2 + (k - y)^2/b^2 - 1
In [548]:
Out[548]:
[[k == r97, a2 == 0, b2 == 0], [k == 1/2*(w1^2*x1^2 - y1^2*z1^2 - w1^2 + y1^2)/(w1*x1^2 - y1*z1^2 - w1 + y1), a2 == -1/4*(w1^4*x1^4 + y1^4*z1^4 - 2*w1^4*x1^2 + w1^4 - 4*w1*y1^3 + y1^4 - 2*(w1^2*x1^2 - 3*w1^2)*y1^2 + 2*(2*w1*y1^3 - y1^4 - (w1^2*x1^2 + w1^2)*y1^2)*z1^2 + 4*(w1^3*x1^2 - w1^3)*y1)/(w1*y1^3 + (w1^2*x1^2 - 2*w1^2)*y1^2 + (w1^2*y1^2 - w1*y1^3)*z1^2 - (w1^3*x1^2 - w1^3)*y1), b2 == 1/4*(w1^4*x1^4 + y1^4*z1^4 - 2*w1^4*x1^2 + w1^4 - 4*w1*y1^3 + y1^4 - 2*(w1^2*x1^2 - 3*w1^2)*y1^2 + 2*(2*w1*y1^3 - y1^4 - (w1^2*x1^2 + w1^2)*y1^2)*z1^2 + 4*(w1^3*x1^2 - w1^3)*y1)/(w1^2*x1^4 + y1^2*z1^4 - 2*w1^2*x1^2 - 2*((w1*x1^2 - w1)*y1 + y1^2)*z1^2 + w1^2 + 2*(w1*x1^2 - w1)*y1 + y1^2)]]
In [561]:
Out[561]:
-w1^3*x1^2*y1 + w1^2*x1^2*y1^2 + w1^2*y1^2*z1^2 - w1*y1^3*z1^2 + w1^3*y1 - 2*w1^2*y1^2 + w1*y1^3 + (w1^3*x1^2*y1 - w1^2*x1^2*y1^2 - w1^2*y1^2*z1^2 + w1*y1^3*z1^2 - w1^3*y1 + 2*w1^2*y1^2 - w1*y1^3)*x^2 + (w1^2*x1^4 - 2*w1*x1^2*y1*z1^2 + y1^2*z1^4 - 2*w1^2*x1^2 + 2*w1*x1^2*y1 + 2*w1*y1*z1^2 - 2*y1^2*z1^2 + w1^2 - 2*w1*y1 + y1^2)*y^2 - (w1^3*x1^4 - w1^2*x1^2*y1*z1^2 - w1*x1^2*y1^2*z1^2 + y1^3*z1^4 - 2*w1^3*x1^2 + w1^2*x1^2*y1 + w1*x1^2*y1^2 + w1^2*y1*z1^2 + w1*y1^2*z1^2 - 2*y1^3*z1^2 + w1^3 - w1^2*y1 - w1*y1^2 + y1^3)*y
In [565]:
Out[565]:
-(w1^2*x1^2 - y1^2*z1^2 - w1^2 + y1^2)*(w1*x1^2 - y1*z1^2 - w1 + y1)
In [11]:
Out[11]:
In [9]:
Out[9]:
3.2188758248682006
In [49]:
Out[49]:
-8.437694987151190e-15
In [4]:
Out[4]:
3.2780315235960593
In [7]:
Out[7]:
In [0]:
In [476]:
Out[476]:
In [0]:
In [337]:
In [335]:
Out[335]:
4*(w1*x1^2 - y1*z1^2 - w1 + y1)*(w1 - y1)*w1*y1/((w1*x1 + y1*z1 + w1 - y1)*(w1*x1 + y1*z1 - w1 + y1)*(w1*x1 - y1*z1 + w1 - y1)*(w1*x1 - y1*z1 - w1 + y1))
In [378]:
Out[378]:
Help on function Rot in module __main__:
Rot(Pol=[[0, 0], [1, 0], [1, 3]], cen=[0, 0], th=30, deg=True, dec=True)
Rot(Pol=[[0,0],[1,0],[1,3]],cen=[0,0],th=30,deg=true) returns the rotation of Pol by th degrees about cen.
In [339]:
Out[339]:
4*(w1*x1^2 - y1*z1^2 - w1 + y1)*(w1 - y1)*w1*y1/((w1*x1 + y1*z1 + w1 - y1)*(w1*x1 + y1*z1 - w1 + y1)*(w1*x1 - y1*z1 + w1 - y1)*(w1*x1 - y1*z1 - w1 + y1))
4*(w1*x1^2 - y1*z1^2 - w1 + y1)^2/((w1*x1 + y1*z1 + w1 - y1)*(w1*x1 + y1*z1 - w1 + y1)*(w1*x1 - y1*z1 + w1 - y1)*(w1*x1 - y1*z1 - w1 + y1))
In [577]:
Out[577]:
In [0]:
In [40]:
Out[40]:
1
[
[k == 1/2*(w1^2*x1^2 - y1^2*z1^2 - w1^2 + y1^2)/(w1*x1^2 - y1*z1^2 - w1 + y1), a == -4*(w1*y1^3 + (w1^2*x1^2 - 2*w1^2)*y1^2 + (w1^2*y1^2 - w1*y1^3)*z1^2 - (w1^3*x1^2 - w1^3)*y1)/(w1^4*x1^4 + y1^4*z1^4 - 2*w1^4*x1^2 + w1^4 - 4*w1*y1^3 + y1^4 - 2*(w1^2*x1^2 - 3*w1^2)*y1^2 + 2*(2*w1*y1^3 - y1^4 - (w1^2*x1^2 + w1^2)*y1^2)*z1^2 + 4*(w1^3*x1^2 - w1^3)*y1), b == 4*(w1^2*x1^4 + y1^2*z1^4 - 2*w1^2*x1^2 - 2*((w1*x1^2 - w1)*y1 + y1^2)*z1^2 + w1^2 + 2*(w1*x1^2 - w1)*y1 + y1^2)/(w1^4*x1^4 + y1^4*z1^4 - 2*w1^4*x1^2 + w1^4 - 4*w1*y1^3 + y1^4 - 2*(w1^2*x1^2 - 3*w1^2)*y1^2 + 2*(2*w1*y1^3 - y1^4 - (w1^2*x1^2 + w1^2)*y1^2)*z1^2 + 4*(w1^3*x1^2 - w1^3)*y1)]
]
In [51]:
In [55]:
In [0]:
In [25]:
Out[25]:
In [32]:
Out[32]:
-(w1^2*y1 - w1*y1^2)*x^2 - (w1*x1^2 - y1*z1^2 - w1 + y1)*y^2 + w1^2*y1 - w1*y1^2 + (w1^2*x1^2 - y1^2*z1^2 - w1^2 + y1^2)*y
In [507]:
Out[507]:
1
[
[b == (w1*x1^2*z1 - ((z1^2 + w1 - 1)*x1 - w1*z1)*y1 - w1*z1)/(w1^2*x1*y1 - w1*y1^2*z1), g == -(w1^2*x1^2 + w1^2*y1 - (z1^2 + w1 - 1)*y1^2 - w1^2)/(w1^2*x1*y1 - w1*y1^2*z1)]
]
In [0]:
In [0]:
In [512]:
Out[512]:
In [0]:
In [384]:
Out[384]:
[(0.939692620785908, 0.342020143325669), (0.644770251820833, 0.267971995712102), (-0.939692620785908, -0.342020143325669), (-1.10446916245796, -0.701647244780572)]
2
In [434]:
Out[434]:
2
In [68]:
In [67]:
Out[67]:
The code below was generated by GPT-3.5 using this prompt:
save a diagram in the png format to my directory
In [0]: