Jak uzyskać region z funkcji numerycznej (!)
Nov 24 2020
Chciałbym otrzymać Region
z funkcji zdefiniowanej czysto numerycznie. Jak ten:
f[r_?NumericQ, th_] := {r Cos[th], r Sin[th]};
Z analitycznego punktu widzenia jest to dość łatwe do osiągnięcia dzięki:
Region[ParametricRegion[{r Cos[th], r Sin[th]}, {{th, 0, 2 Pi}, {r, 0, 1}}]]
Ale jak mam to zrobić ze zdefiniowanym numerycznie f
?
Odpowiedzi
6 CarlWoll Nov 24 2020 at 02:20
Musisz podać ParametricRegionlistę jako pierwszy argument. Ponadto, BoundaryDiscretizeRegionjest lepszym wyborem dla wizualizacji funkcji liczbowej:
Clear[f]
f[r_?NumericQ, th_] := {r Cos[th], r Sin[th]}
BoundaryDiscretizeRegion @ ParametricRegion[
{Indexed[f[r, th], 1], Indexed[f[r, th], 2]},
{{th, 0, 2 Pi}, {r, 0, 1}}
]
