## 19295 Reputation

14 years, 206 days

## Possible way...

A:=[1,2]:

B:= [3,4]:

C:= [op(A), op(B)];

## Right...

That's right (just missing a colon in a row)! As it should be found two solutions.

## Code...

Normal vector  (a, b, c)  to your plane can be obtained as the solution of the system

solve({a^2+b^2+c^2=1, a*(0-2)+b*(1-(-1))+c*(-2-0)=0, abs(a+2*b+c)/sqrt(1+2^2+1)=1/2});

## Code...

Normal vector  (a, b, c)  to your plane can be obtained as the solution of the system

solve({a^2+b^2+c^2=1, 5*a-2*b+5*c=0, abs(a-4*b-8*c)/sqrt(1+4^2+8^2)=sqrt(2)/2});

## Comment...

Your statement  2)  " Vector(MH) perpendicular to direction vector a = (2, 1, -1) of (d)"  is false!

## Procedure...

Your problem  is no different from the previous plane (3). The procedure P solves the problem for any points A, B, M and numeric d (points should not be collinear).

Procedure code:

restart:

P:=proc(A,B,M,d)

local P,Sol,L,f,L1;

uses RealDomain, LinearAlgebra, ListTools;

if Equal(simplify(CrossProduct(convert(B,Vector)-convert(A,Vector),convert(M,Vector)-

convert(A,Vector))),<0,0,0>) then error `Points A, B, M should not be collinear`; fi;

P:=a*(x-A[1])+b*(y-A[2])+c*(z-A[3]);

Sol:=[solve({subs(x=B[1],y=B[2],z=B[3],P)=0,a^2+b^2+c^2=1,

abs(subs(x=M[1],y=M[2],z=M[3],P))=d},{a,b,c})];

L:=[seq(<rhs(Sol[i,1]),rhs(Sol[i,2]),rhs(Sol[i,3])>,i=1..nops(Sol))];

f:=(x,y)->Equal(simplify(CrossProduct(x,y)),<0,0,0>);

L1:=[Categorize(f, L)];

if nops(L1)=0 then print(`The problem has no solutions`); fi;

if nops(L1)=1 then print(`The problem has 1 solution`); print(collect(subs(a=L1[1][1][1],b=L1[1][1][2],c=L1[1][1][3],P),[x,y,z])=0); fi;

if nops(L1)=2 then print(`The problem has 2 solutions`); print(collect(subs(a=L1[1][1][1],b=L1[1][1][2],c=L1[1][1][3],P),[x,y,z])=0); print(collect(subs(a=L1[2][1][1],b=L1[2][1][2],c=L1[2][1][3],P),[x,y,z])=0); fi;

end proc;

As an exapmle see solution the problem  plane (3)

P([-1,3,-6],[2,2,-10],[1,-1,7],3);

Similarly, you can find equation of a plane (4)

## Right...

That's right! Probably it would look better if you write

[seq(M[i]=(A + u*t)[i],i=1..3)];

or

{seq(M[i]=(A + u*t)[i],i=1..3)};

or

op([seq(M[i]=(A + u*t)[i],i=1..3)]);

## Rewrited code...

Once posted the previous message, noticed in it one essential disadvantage. The code will not work if the points A, B, N1 are collinear. Therefore, rewrote the code using your idea. The code is simpler, and the result , of course, is the same:

with(LinearAlgebra):

N1:=convert(N1,Vector):

n:=o-N1:  e:=n/simplify(Norm(n,2)):

T:=<x,y,z>-N1:

collect(expand(DotProduct(e,T,conjugate=false)),[x,y,z])=0; #  Equation of the plane P

## Solution...

You have 2 planes: ABN1 and ABN2. Find the equation ABN1. The simplest way to use the determinant. The code (the continuation of the previous code):

N1:=convert(N1,Vector):

T:=<x,y,z> - N1: N1-A: N1-B:

P1:=collect(LinearAlgebra[Determinant](< T | N1-A | N1-B >),[x,y,z]):

k:=simplify(sqrt(coeff(P1,x)^2+coeff(P1,y)^2+coeff(P1,z)^2)):

P2:=simplify(collect(P1/k,[x,y,z])):

P:=collect(P2,[x,y,z])=0;  # Equation of the plane P

simplify(coeff(lhs(P),x)^2+coeff(lhs(P),y)^2+coeff(lhs(P),z)^2); # Checking

Similarly, we find a second plane.

## The procedure...

Here is the procedure for you:

primesum:=proc(n::posint)

local S, i;

S:=0;

for i from 1 to n do

if isprime(i) then S:=S+i;  fi;

od;

S;

end proc;

## Vector field...

I beg your pardon! I was not careful enough answering to your question. You have not a real function but the vector field! It is time-dependent field, ie it changes with time! So you can picture it, fixing a point in time. To plot such a field you may using the command plots[fieldplot3d] . You can even see how it changes over time, using animation. Your field has two peculiarities: it is independent of the first two coordinates of the point (x, y, z), but only on the coordinate z, and any vector is parallel to the plane xOy. So the point of application of the vectors can be taken only on any one vertical line! For such plotting, you can use the command plots[arrow] .

## The idea of ​​the solution...

If N (x0, y0, z0) is the point of tangency, then the three conditions:

1) The distance from N to the center of the sphere (point O) is equal to the radius.

2) ON is perpendicular to  AN.

3) ON is perpendicular to BN.

## Another variant...

Mr. Hirnyk wrote: " Kitonum's code finds only the minimal value of the sums, not the minimum sum".

Here is the version of the code which finds also all the minimum sums:

P1:=proc(L)

local It, M,S,S1,R,T,i;

It:=proc(K)

[seq([-1,op(K[i])],i=1..nops(K)),seq([1,op(K[i])],i=1..nops(K))];

end proc;

M:=(It@@nops(L))([[ ]]);

S:=[seq([seq(L[j]*M[i,j],j=1..nops(L))],i=1..nops(M))];

R:=min(S1);

T:=[];

for i from 1 to nops(S) do

if S1[i]=R then T:=[abs(`%+`(op(S[i]))),op(T)]; fi;

od;

print(Minimum=R);

op(T);

end proc:

Example:

st:= time():  P1([seq(i^2,i=1..15)]);  time() - st; nops([%%]);

All 86 solutions were found for 1.841 sec

## Impossible equality...

The equality (1/m)^(N+1) = 0 is impossible for any m!

## Correction and simplification...

Here is corrected and simplified the code:

restart;

N := 2;

alias(epsilon = e, eta = t);

eq1 := 5*diff(F(t), t\$3)+(1+3*e)*F(t)*diff(F(t), t\$2)-(2+e)*diff(F(t), t)^2 = 0;

G :=unapply(add(F[i](t)*e^i, i = 0 .. N),t);

deqn := simplify(collect(subs(F(t)=G(t),eq1), e), {e^(N+1) = 0});

 First 270 271 272 273 274 Page 272 of 274
﻿