I'm trying to create a football-shaped object by rotating an arc of a circle about a line. Is there a way to define an arc in Maple? I've been using the 3D Geometry package but I can switch to another if I need to. I know I can calculate the arc length, but is there a way to define the arc itself as an object? Eventually, I'd like to have the rotation of the arc and find the intersection between the rotation and another line.
Thanks for your help,
Michael
Rotating an arc
I don't think the geom3d package is useful here.
The simplest way to define a 3d arc is using a parametric curve, giving the coordinates as a function of a parameter t in some interval. For example:
A := <cos(t), sin(t), 0>;
Rotations can then be done using, e.g., RotationMatrix in the Student[LinearAlgebra] package.
Surface of revolution
You can get the result, a surface of revolution, this way:
rotating an arc
I discovered the surface of revolution earlier today. However, it appears to me like it can only rotate vertically or horizontally. The problem I'm trying to figure out is I have two points A(1,0,0) and B(0,0,2^.5) and I have an arc AB such that for any point p on the arc, angle ApB = 120 degrees. I'd like to rotate this arc about the line containing A and B, which would make a surface of revolution. This surface would contain all points p where angle ApB = 120°.
I think I remember working with rotation matrices, but it was a long time ago. Would that result in a surface or would it just be a transformation?
Thanks again.
Try this
a := eval( Student[Calculus1][SurfaceOfRevolution] (sqrt(1-x^2), x = -sqrt(3)/2 .. sqrt(3)/2, distancefromaxis = 1/2, output = plot), TITLE = NULL): b := plottools[rotate]( a, 0, -arctan(sqrt(2)), 0): A := Student:-LinearAlgebra:-RotationMatrix( arctan(sqrt(2)), <0, 1, 0>): t := A.<sqrt(3)/2, 0, 1/2>; c := plottools[translate](b, 1/2-sqrt(6)/6, 0, sqrt(2)/2-sqrt(3)/6): plots[display](c, scaling = constrained);Alec
Or with implicitplot3d
Or simple
P, Q, X := <1,0,0>, <0,0,sqrt(2)>, <x,y,z>: eq:=cos(Student:-LinearAlgebra:-VectorAngle(X-P,X-Q))=-1/2: plots[implicitplot3d](eq, x=-0.1..1.1,y=-0.5..0.5,z=-0.1..1.5, numpoints=10000, axes=normal, style=patchnogrid, color=red, lightmodel=light4, scaling=constrained, orientation=[-120,66], glossiness=0.85);giving about the same picture as above.
Alec
Parametric plot
If I needed that for myself, I would, probably, use a parametric plot, which can be done with the same options as above, as
with(Student:-LinearAlgebra): P,Q:=<1,0,0>,<0,0,sqrt(2)>: center:=(P+Q)/2: e1,e2:=map(Normalize,NullSpace(Transpose(<P-Q>)))[]: f1:=Normalize(P-Q): f2:=e1*cos(alpha)+e2*sin(alpha): cc:=center-f2/2: plot3d(cc+f1*cos(beta)+f2*sin(beta), alpha=0..2*Pi,beta=Pi/6..5*Pi/6, axes=normal, style=patchnogrid, color=red, lightmodel=light4, scaling=constrained, orientation=[-120,66], glossiness=0.85);Alec
one final step...
Thanks so much for the help Alec. Here's what I've got now. I've decided to go with the implicitplot3d.
P,Q,R,S,X := <1,0,0>,<0,0,sqrt(2)>,<-.5,sqrt(3)/2,0>,<0,0,-sqrt(2)>,<x,y,z>:
eq1:=cos(Student:-LinearAlgebra:-VectorAngle(X-P,X-Q))=-1/2:
eq2:=cos(Student:-LinearAlgebra:-VectorAngle(X-R,X-S))=-1/2:
T:=[-1/2,-sqrt(3)/2,0]:
plots[implicitplot3d]([eq1,eq2],
x=-1.1..1.1,y=-1.1..1.1,z=-1.5..1.5,
numpoints=25^3,
axes=normal,
style=patchnogrid,
color=[red,blue],
lightmodel=light4,
scaling=constrained,
orientation=[-90,60],
glossiness=0.75);
This creates two of the footballs, the original and one with endpoints R(-1/2,sqrt(3)/2,0) and S(0,0,-sqrt(2)). T is a point that makes an equilateral triangle with P and R in the xy-plane. I'm having trouble defining points A and B, each on the one of surfaces, and point C which connects A, B, and T so that all the angles at C are 120°. I don't know if this will result in multiple options for the coordinates of A,B, and C, but if it does then I'd like to maximize the two distances AC and BC while keeping the angles all 120°. Thanks for any help you can give.
A question
What do you mean by maximizing the two distances AC and BC? Maximizing of their sum? Would maximizing of the distance between A and B be good enough?
With the given description, A can be any point on the first surface, B can be any point on the second surface, and C can be found in the triangle ABT - it belongs to this triangle because the sum of angles is 360 degrees.
For example, one can choose A=Q and B=S - in this case C can be found as
T:=<-1/2,-sqrt(3)/2,0>: C:=simplify(Student:-LinearAlgebra:-Normalize(T)*sqrt(6)/3); [ 1/2] [ 6 ] [- ----] [ 6 ] [ ] C := [ 1/2] [ 2 ] [- ----] [ 2 ] [ ] [ 0 ]but that doesn't give the maximal possible distance between A and B, which can be found numerically as
Digits:=50; Optimization:-Maximize( (x^2-2*x*x1+x1^2+y^2-2*y*y1+y1^2+z^2-2*z*z1+z1^2), [((x-1)*x+y^2+z*(z-2^(1/2)))<= (x^2-2*x+1+y^2+z^2)^(1/2)*(x^2+y^2+(z-2^(1/2))^2)^(1/2)*(-1/2), ((x1+.5)*x1+(y1-1/2*3^(1/2))*y1+z1*(z1+2^(1/2)))<= ((x1+.5)^2+(y1-1/2*3^(1/2))^2+z1^2)^(1/2)*(x1^2+y1^2+(z1+2^(1/2))^2)^(1/2)* (-1/2)] , initialpoint={x=0.,y=0.,z=1.4,x1=0.,y1=0.,z1=-1.4}, iterationlimit=10000); [8.1068573568932429948450711882419848469456512046164, [ x = 0.20900828721929509855749372290032000436215101169524, x1 = -0.11909928245049037658422077838848462671859967267401, y = -0.016853014677241137784700532294613882145324480264344, y1 = 0.17257997899476339620053756605330815264740462412371, z = 1.4109675687739151713428845085848428410846956205996, z1 = -1.4109675687739151713428848374439038731027167230894]]with A=<x,y,z> and B=<x1,y1,z1>, and few last digits should be discharged. In this case,
C:=evalf((A+B)/2+Normalize(T-(A+B)/2)*Norm(A-B)/2/sqrt(3)); C := [-0.36601126456211906471370215142443360835944093368602] [-0.63395010636412432525211006390698263585743961460865] [ -25] [-0.4042852158498854283239052002723336497270506172655 10 ]with
Norm(A-C); 1.6438630677860857028013503100457476963688872976097 Norm(B-C); 1.6438630677860857028013522804687256238377757565536which is greater than in the first example with A=Q and B=S with AC=BC=2*sqrt(6)/3,
evalf(2*sqrt(6)/3); 1.6329931618554520654648560498039275946439649871045Alec
Parametric plot (part 2)
Plotting the second football is slightly more tricky, but can be done as follows. First, I'll repeat the first construction,
with(Student:-LinearAlgebra): P,Q:=<1,0,0>,<0,0,sqrt(2)>: center:=(P+Q)/2: e1,e2:=map(Normalize,NullSpace(Transpose(<P-Q>)))[]: f1:=Normalize(P-Q): f2:=e1*cos(alpha)+e2*sin(alpha): cc:=center-f2/2: a:=plot3d(cc+f1*cos(beta)+f2*sin(beta), alpha=0..2*Pi,beta=Pi/6..5*Pi/6, axes=normal, style=patchnogrid, color=red, lightmodel=light4, scaling=constrained, orientation=[-120,66], glossiness=0.85 ):Now, the second one,
R,S:=<-1/2,sqrt(3)/2,0>,<0,0,-sqrt(2)>: center1:=(R+S)/2: g1,g2:=NullSpace(Transpose(<R-S>))[]: g1:=solve((x*g1+g2).g2)*g1+g2: g1,g2:=map(Normalize,[g1,g2])[]: h1:=Normalize(R-S): h2:=g1*cos(phi)+g2*sin(phi): cc1:=center1-h2/2: b:=plot3d(cc1+h1*cos(theta)+h2*sin(theta), phi=0..2*Pi,theta=Pi/6..5*Pi/6, axes=normal, style=patchnogrid, color=blue, lightmodel=light4, scaling=constrained, orientation=[-120,66], glossiness=0.85 ):Finally,
Alec