## 13765 Reputation

11 years, 154 days

## Comment...

Why do you think that the point H is the projection of the midpoint of AB on the plane P? If this is true, then your solution is also true!

Dear Mr. toandhsp! I've already written for you several procedures. Now learn to do it yourself!

Dear Mr. toandhsp! I've already written for you several procedures. Now learn to do it yourself!

## Error...

Dear Mr. Hirnik! Unfortunately, the calculations made ​​by you in the package DirectSearch are wrong! Look at the screenshot and all become clear. First, using the procedure P1 i found true minimum for the first 10 numbers from your list, then for next 15. From the inequality |a+b|<=|a|+|b| obtained a rough estimate of initial minimum. I think that actually it is even much less!

## Error...

Dear Mr. Hirnik! Unfortunately, the calculations made ​​by you in the package DirectSearch are wrong! Look at the screenshot and all become clear. First, using the procedure P1 i found true minimum for the first 10 numbers from your list, then for next 15. From the inequality |a+b|<=|a|+|b| obtained a rough estimate of initial minimum. I think that actually it is even much less!

## Correction...

Your code does not work because:

1) For the command DotProduct the option conjugate=false is required.

2) The system has not one but two solutions.

The corrected code:

restart:

with(LinearAlgebra):

A:=<-1,3,6>: B:=<2,2,-0>: N:=<x,y,z>: o:=<1,-1,7>:

Sys:={Norm(o-N,2)^2=9, DotProduct(N - o, N-A,conjugate=false) = 0, DotProduct(N - o, N-B,conjugate=false) = 0}:

Sol:=[solve(Sys)]:

N1:=[seq(rhs(Sol[1,i]),i=1..3)];

N2:=[seq(rhs(Sol[2,i]),i=1..3)];

## Correction...

Your code does not work because:

1) For the command DotProduct the option conjugate=false is required.

2) The system has not one but two solutions.

The corrected code:

restart:

with(LinearAlgebra):

A:=<-1,3,6>: B:=<2,2,-0>: N:=<x,y,z>: o:=<1,-1,7>:

Sys:={Norm(o-N,2)^2=9, DotProduct(N - o, N-A,conjugate=false) = 0, DotProduct(N - o, N-B,conjugate=false) = 0}:

Sol:=[solve(Sys)]:

N1:=[seq(rhs(Sol[1,i]),i=1..3)];

N2:=[seq(rhs(Sol[2,i]),i=1..3)];

## It's impossible...

Your function depends on 4 variables. To plot only if the number of variables does not exceed 2.

## The corrected code...

Here is the corrected code:

A:=<0,1,2>:  M:=<2*t,1 + t,-1 - t>: N:=<1+m, -1 -2*m,2+m>:

u:=A - M: v:=A - N:

w:=LinearAlgebra[CrossProduct](u,v):

solve([seq(w[i]=0,i=1..3)]): assign(%):

'M'=M; 'N'=N;

## The corrected code...

Here is the corrected code:

A:=<0,1,2>:  M:=<2*t,1 + t,-1 - t>: N:=<1+m, -1 -2*m,2+m>:

u:=A - M: v:=A - N:

w:=LinearAlgebra[CrossProduct](u,v):

solve([seq(w[i]=0,i=1..3)]): assign(%):

'M'=M; 'N'=N;

## Incorrect argument...

Why do you think that the parameters of two different lines for the same point must be the same? Take t =- 1 / 3 for the first line, and t = 2 / 3 for the second straight. Get the same point!

## Incorrect argument...

Why do you think that the parameters of two different lines for the same point must be the same? Take t =- 1 / 3 for the first line, and t = 2 / 3 for the second straight. Get the same point!

If k is not 0 and not 1, then your problem will have two solutions. For example, for your example the second solution would be if you take k =- 2 in your formulas .