minhthien2016

385 Reputation

6 Badges

8 years, 31 days

MaplePrimes Activity


These are answers submitted by minhthien2016

You can use geometry package.
 

restart;
with(geometry);
point(A, 2, 3);
point(B, 6, 6);
coordinates(midpoint(M, A, B));
simplify(distance(A, B));

You can use geom3d.
Let I be the center of the sphere. Then, the center of the circle, which is the intersection of the sphere and the plane Oxy, is the projection of I onto the plane Oxy.

restart;
with(geom3d);
point(P, 3, 7, 4);
R := 5;
plane(oxy, z = 0, [x, y, z]);
plane(oyz, x = 0, [x, y, z]);
coordinates(projection(T, P, oxy));
d1 := distance(P, oxy);
r1 := sqrt(R^2 - d1^2);
coordinates(projection(C, P, oyz));
d2 := distance(P, oyz);
r2 := sqrt(R^2 - d2^2);

Note that, you can assum A^2 + B^2 + C^2 = 1. I copy this code from Kitonum's answer.
 

restart:
local D:
np:=<A,B,C>: nq:=<1,-1,0>: P:=A*x+B*y+C*z+D=0: M:=[1,0,0]: N:=[0,0,-1]:
Sys1:=eval(P,[x,y,z]=~M);
Sys2:=eval(P,[x,y,z]=~N);
Sys3:=(np.nq)/sqrt(np.np)/sqrt(nq.nq)=cos(Pi/4) assuming real;
Sol:=[solve({Sys1,Sys2,Sys3,A^2 + B^2 + C^2 =1})];
eval(P,Sol[1]); # The first solution
simplify(eval(P,Sol[2])); # The second solution

You can use

 

with(Student:-MultivariateCalculus):
 A := [0, -3]:
 B := [3, 1]:
 P := [5, -2]:
 d := Line(A, B):
H := Projection(P, d);

 

Page 1 of 1