I have two codes to find the integer numbers $m$, $x$, $y$, $z$ in the system of equations. First code
Solve[{( m x + y - 7 z)^2 ==
Cos[\[Pi]/3]^2*(x^2 + y^2 + z^2)*(m^2 + 1^2 + 7^2), -10 <= m <=
10, -10 <= x <= 10, -10 <= y <= 10, -10 <= z <= 10}, {m, x, y,
z}, Integers]
Second code
Clear[a, b];
a = {m, 1, -7};
b = {x, y, z};
Solve[{Abs[a . b]/(Norm[a] Norm[b]) == Cos[\[Pi]/6], 0 <= m <= 10,
0 <= x <= 10, 0 <= y <= 10, 0 <= z <= 10}, {m, x, y, z}, Integers]
The first code run faster the second code. I can not get the answer of the second code. How to edit the second code? How do I tell Mathematica to do that?
0 <= m <= 10, 0 <= x <= 6, 0 <= y <= 4, 0 <= z <= 10
. For instance, explore the situation withManipulate[ContourPlot3D[f[m, x, y, z], {x, 0, 10}, {y, 0, 10}, {z, 0, 10}, Contours -> {0}, AxesLabel -> {x, y, z}], {m, 0, 10}]
after definingf[m_, x_, y_, z_] := With[{a = {m, 1, -7}, b = {x, y, z}}, (a.b)^2 - (a.a) (b.b) Cos[\[Pi]/6]^2]
. $\endgroup$