I have written these codes:

ClearAll[“Global`*”];

r = (6.3674447) (10^6);

θm = (90 – 21.43) Degree;

φm = 39.82 Degree;

θe = (90 – 56.85) Degree;

φe = 60.6 Degree;

RM = {r Sin[θm] Cos[φm] , r Sin[θm] Sin[φm], r Cos[θm]};

RE = {r Sin[θe] Cos[φe] , r Sin[θe] Sin[φe], r Cos[θe]};

Q = FullSimplify[RM – RE];

x = {-Sin[φe], Cos[φe], 0};

y = {-Cos[θe] Cos[φe], -Cos[θe] Sin[φe], Sin[θe]};

z = x × y;

sol = N[FullSimplify[({Q·x, Q·y, Q·z}·y)/Norm[Q]]];

ArcCos[sol]

But at last I get:

While everything is numerical and computable.

What’s gone wrong?

EDIT:

For ones who may worry about code mistype (i.e. using dot instead of [CenterDot]), here is my pure code (I didn’t replace anything):

ClearAll[“Global`*”];

r = (6.3674447) (10^6);

\[Theta]m = (90 – 21.43) Degree;

\[Phi]m = 39.82 Degree;

\[Theta]e = (90 – 56.85) Degree;

\[Phi]e = 60.6 Degree;

RM = {r Sin[\[Theta]m] Cos[\[Phi]m] , r Sin[\[Theta]m] Sin[\[Phi]m], r Cos[\[Theta]m]};

RE = {r Sin[\[Theta]e] Cos[\[Phi]e] , r Sin[\[Theta]e] Sin[\[Phi]e], r Cos[\[Theta]e]};

Q = FullSimplify[RM – RE];

x = {-Sin[\[Phi]e], Cos[\[Phi]e], 0};

y = {-Cos[\[Theta]e] Cos[\[Phi]e], -Cos[\[Theta]e] Sin[\[Phi]e], Sin[\[Theta]e]};

z = x\[Cross]y;

sol = N[FullSimplify[({Q\[CenterDot]x, Q\[CenterDot]y, Q\[CenterDot]z}\[CenterDot]y)/Norm[Q]]];

ArcCos[sol]

=================

1

So where is φm defined and I assume you want Dot?

– gwr

Jun 2 at 8:38

1

Ah so it is center dot in the code too, then “CenterDot[x,y,[Ellipsis]] has no built-in meaning.”

– Kuba

Jun 2 at 8:39

2

@gwr s7.picofile.com/file/8254032118/…

– AHB

Jun 2 at 8:45

1

Yes, that is misleading, but it is simply explaining the use of a symbol in mathematical typesetting (could be for LATEX\LaTeX…). Try ?\[CenterDot] and ?..

– gwr

Jun 2 at 8:48

1

@AHB The highlighted part merely says the symbol is used to indicate the dot product in mathematics, not Mathematica.

– Taiki

Jun 2 at 9:06

=================

1 Answer

1

=================

The confusion simply arises from mistaking a typesetting information for \[CenterDot] with the meaning of a symbol. Replacing · with . will solve the issue:

ClearAll[“Global`*”];

r = (6.3674447) (10^6);

θm = (90 – 21.43) Degree;

ϕm = 39.82 Degree;

θe = (90 – 56.85) Degree;

ϕe = 60.6 Degree;

RM = {r Sin[θm] Cos[ϕm] , r Sin[θm] Sin[ϕm], r Cos[θm]};

RE = {r Sin[θe] Cos[ϕe] , r Sin[θe] Sin[ϕe], r Cos[θe]};

Q = FullSimplify[RM – RE];

x = {-Sin[ϕe], Cos[ϕe], 0};

y = {-Cos[θe] Cos[ϕe], -Cos[θe] Sin[ϕe], Sin[θe]};

z = x \[Cross] y;

sol = N[FullSimplify[({Q.x, Q.y, Q.z}.y)/Norm[Q]]];

ArcCos[sol]

0.916203

As @Kuba has pointed out, the confusion ends reading this: