Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- r = 1;
- listaKatow = Table[RandomReal[{0, 2 Pi}], {i, 100}];
- powierzchnia[x_, y_] = 2 x + 3 y^2;
- f[x_, y_] = x^2 + y^2 + (2 x + 3 y^2)^2 - r^2;
- alfa = listaKatow[[1]];
- Result = Solve[{x, y} \[Element]
- InfiniteLine[{{0, 0}, {Cos[alfa], Sin[alfa]}}] &&
- f[x, y] == 0, {x, y}];
- xPunktu = Result[[1, 1, 2]];
- yPunktu = Result[[1, 2, 2]];
- zPunktu = powierzchnia[xPunktu, yPunktu];
- xPunktu2 = Result[[2, 1, 2]];
- yPunktu2 = Result[[2, 2, 2]];
- zPunktu2 = powierzchnia[xPunktu2, yPunktu2];
- dlugosc = Sqrt[xPunktu^2 + yPunktu^2 + zPunktu^2]
- dlugosc2 = Sqrt[xPunktu2^2 + yPunktu2^2 + zPunktu2^2]
- Show[
- ContourPlot[{y*Cos[alfa] - x*Sin[alfa], f[x, y] == 0}, {x, -2.,
- 2.}, {y, -2., 2.}],
- Graphics[{{Blue,
- InfiniteLine[{{0, 0}, {Cos[alfa], Sin[alfa]}}]}, {Red,
- Point[{x, y}] /. Result}}]
- ]
- Show[
- Plot3D[{2 x + 3 y^2}, {x, -1, 1}, {y, -1, 1}, BoxRatios -> {1, 1, 1}],
- Graphics3D[{Red, PointSize[.04], Point[{0, 0, 0}]}],
- Graphics3D[{Green, PointSize[.04],
- Point[{xPunktu, yPunktu, zPunktu}]}],
- Graphics3D[{Blue, PointSize[.04],
- Point[{xPunktu2, yPunktu2, zPunktu2}]}],
- Graphics3D[{Opacity[0.5], Sphere[{0, 0, 0}, r]}]
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement