50

I've put this code on a GitHub but I don't know what features are needed or what problems it may give. I'm just not using it. But I will incorporate incomming suggestions as soon as I have time. Feedback in form of tests and suggestions very appreciated! (If[DirectoryQ[#], DeleteDirectory[#, DeleteContents -> True]]; CreateDirectory[#]; URLSave[ "...


25

Since ContourPlot[] returns a GraphicsComplex, you could also replace the point list of the plot with g @@@ pointlist where g is the coordinate transformation. For example f[r_, th_] := th^2 - (3 Pi/4)^2 Cos[r] g[r_, th_] := {r Cos[th], r Sin[th]} pl = ContourPlot[f[r, th] == 0, {r, 0, 8 Pi}, {th, 0, 2 Pi}, PlotPoints -> 30]; pl[[1, 1]] = g @@@ pl[[1, ...


18

Doing this with basic image processing can be done. In comparison to the post you have linked, your situation is more complicated because you have a monochrome image with no option to separate colors. Additionally, your graph is surrounded by a frame. Let's assume we want to separate not the line but the area under or over the line that is inside the frame. ...


16

You're very close: First, ImageTransformation by default assumes that the range of the coordinate system for the input image is [...] {{0,1},{0,a}}, where a is the aspect ratio If you want to work with pixel coordinates, you have to add PlotRange->Full. Second, the transformation passed to ImageTransformation should transform coordinates from the ...


14

Using Composition I can apply RotationTransform, TranslationTransform , ShearingTransform one after the other. Graphics3D[{ Opacity[1] , Red , Arrow[{{0, 0, 0}, {1, 0, 0}}] , Green , Arrow[{{0, 0, 0}, {0, 1, 0}}] , Blue , Arrow[{{0, 0, 0}, {0, 0, 1}}] , Opacity[0.2] , GeometricTransformation[Cuboid[-{1, 1, 1}/4, {1, 1, 1}/4], ...


14

Thank you for your interest. I would strongly recommend against trying to modify SymbolicTensors`CoordinateChartDataDump`mappingInfo. It is a very low level function and any changes you make are unlikely to work. There are two sets of operations commonly needed with alternate coordinate systems. One is calculus in the coordinate system - Grad, Div, Curl ...


13

EulerMatrix is available in MMA 10. To obtain the matrix for the transformation shown in your sketch, apply EulerMatrix[{α,β,γ},{3,1,3}] This transformation is known as the x-convention, because the second rotation is about x'-axis. The Wikipedia designates this by ZXZ. Those who do not have MMA 10 can obtain the same x-convention transformation using ...


13

You can use TransformedField to get a function that can be used as the first argument of ContourPlot: f = (r^2 - a^3/r) Sin[t]^2; tf = TransformedField[ "Polar" -> "Cartesian", f, {r, t} -> {x, y}] TeXForm @ tf $\frac{y^2 \left(x^2 \sqrt{x^2+y^2}+y^2 \sqrt{x^2+y^2}-1\right)}{\left(x^2+y^2\right)^{3/2}}$ cValues = {0.00001, 0.01, 0.05, 0.1, 0.3, ...


12

This seems to work: ImageTransformation[polar, {ArcTan @@ (radius - #), Norm[# - radius]} &, {2 radius, 2 radius}, DataRange -> {{-180 \[Degree], 180 \[Degree]}, {1, radius}}, PlotRange -> {{0, 2 radius}, {0, 2 radius}}] Notes: Don't call ArcTan[y/x]. You'd only get an angle between -90°..90°. There's an overload ArcTan[x,y] that returns ...


12

Does this ContourPlot[ Evaluate@With[ {r = Sqrt[x^2 + y^2], θ = ArcTan[x, y]}, θ^2 - Cos[r] == 0 ], {x, 0.1, 4 Pi}, {y, 0, 4 Pi} ] work? Plot:


12

For instance, you can do the following: Show[Graphics3D[ MapThread[{Black, Arrow@Tube@{{0, 0, 0}, #1}, Text[#2, #1, {0, -1}]} &, {2 IdentityMatrix[3], {x, y, z}}], Boxed -> False], ContourPlot3D[ x^2 + y^2 + z^2 == 1, {x, -1, 1}, {y, -1, 1}, {z, -1, 1}, ContourStyle -> Opacity[1/2]]]


11

If you can transform it to a parametric form: ParametricPlot[ Evaluate @ CoordinateTransform["Polar" -> "Cartesian", {r, Cos[r]}], {r, 0, 50} ] And if you have to use implicit form: ContourPlot[ Evaluate[ TransformedField[ "Polar" -> "Cartesian", θ == Cos[r], {r, θ} -> {x, y} ] ] , {x, 0, 50} , {y, -...


10

If you allow negative radii, there's another entire half of the solution: PolarPlot[ Evaluate[Flatten[ Table[{-ArcCos[(16 t^2)/(9 Pi^2)], ArcCos[(16 t^2)/(9 Pi^2)]} + k 2 Pi, {k, -2, 2}] ]], {t, -Pi, Pi}, PlotStyle -> Table[Directive[Thick, Hue[i/10]], {i, 10}] ]


10

Area As described on this page, the area enclosed by a polar curve is given by $$A = \int_\alpha^\beta \frac{r(\theta)^2}{2} \mathrm{d}\theta$$ In your case this is, Integrate[Sin[2 θ]^2/2, {θ, 0, π}] N@% (* π/4 *) (* 0.785398 *) You can get this same answer using Region functionality by first making a RegionPlot, converting it to a MeshRegion and ...


10

Employing most of your own code; Integrate[ f @@ CoordinatesToCartesian[#, Spherical @@ #] JacobianDeterminant[Spherical @@ #] &@{r, θ, ϕ}, {r, 0, R}, {θ, 0, π}, {ϕ, -π, π} ] (4 π R^3)/3 That is, you just have to add the integral boundaries.


9

By ParametricPlot: ParametricPlot[{x Cosh[t], x Sinh[t]}, {t, -Pi/4, Pi/4}, {x, 0, 4}, PlotRange -> {{0, 1.5}, {-1, 1}}, BoundaryStyle -> Dashed] or, for fun: ParametricPlot[{x Cosh[t], x Sinh[t]}, {t, -Pi/4, Pi/4}, {x, 0, 4}, PlotRange -> {{0, 1.5}, {-1, 1}}, BoundaryStyle -> Directive[Thick, Red, Dashed], PlotStyle -> Pink, ...


9

You can do something like this: ContourPlot[ArcTan[x,y]^2 == (3 Pi/4)^2 Cos[Sqrt[x^2 + y^2]], {x, -23, 23}, {y, -23, 23}, ContourStyle -> Directive[Thick, Orange]]


9

I made 10 points randomly and selected points as vertex of right-angled triangle using VectorAngle. pts = RandomInteger[{0, 9}, {10, 2}] {{2, 6}, {7, 9}, {8, 7}, {4, 8}, {1, 1}, {7, 3}, {9, 1}, {3, 1}, {4, 4}, {7, 3}} vts = Permutations[pts, {3}]; rst = Select[vts, VectorAngle @@ Differences[#1] == \[Pi]/2 &]; trig = Union[rst, SameTest -> (...


9

expr = x^2 D[u[x, y], {x, 2}] - D[u[x, y], {y, 2}] + D[u[x, y], y] $Assumptions = {s > 0, t > 0} expr /. u -> (u[# Exp[#2], # Exp[-#2]] &) /. {x -> Sqrt[s t], y -> Log[Sqrt[s/t]]} // Simplify Second set of replacement rules is from: Eliminate[s == x Exp[y] && t == x Exp[-y], ...


9

How about you make a ListDensityPlot as usual in the original polar coordinates and then transform the vertices to Cartesian coordinates. data = Flatten[ Table[{r, θ, Sin[3 r] Cos[3 θ]}, {r, 0, 2 π, 2 π/100}, {θ, 0, 2 π, 2 π/100}], 1]; plot = ListDensityPlot[data] transformGraphicsComplex[f_, g_] := GraphicsComplex[f /@ First[g], Sequence @@ Rest[g]] ...


9

To address your actual problem: If you're just looking to re-orient your B-spline cylinder, there's no need to go through the Euler angles. Here's one way. Consider the following cylinder: myCyl = BSplineSurface[{{{0, 0, 0}, {0, 1, 0}, {1, 1, 0}, {1, 0, 0}}, {{0, 0, 1}, {0, 1, 1}, {1, 1, 1}, {1, 0, 1}}}, ...


9

What you tried is the syntax for a parametric surface. However, you want to plot the coordinate lines. This can be done by stepping through one of the coordinate ranges in discrete steps and plotting a continuous parametric line by varying the other coordinate: Show[ParametricPlot[ Evaluate[Table[ Tooltip[{Sinh[v]/(Cosh[v] - Cos[u]), Sin[u]/(Cosh[v] - ...


9

The "Details" section of that page refers to CoordinateChartData. Now this is a bit dense, but it contains everything you need. First of all, you can try to find out what kind of things you can find out about spherical coordinates: In[9]:= CoordinateChartData["Spherical", "Properties"] Out[9]= {"AlternateCoordinateNames", "CoordinateRangeAssumptions", ...


8

Using @b.gatessucks' hint, I solved it with the following transformation: max = Max[data]; Show[ ListPlot[{Sqrt[max #[[2]]] Sin[Sqrt[max #[[1]]]], Sqrt[max #[[2]]] Cos[Sqrt[max #[[1]]]]} & /@ data, AspectRatio -> 1, PlotRange -> {{-20, 20}, {-20, 20}}], ParametricPlot[{t Sin[t], t Cos[t]}, {t, 0, 20}]]


8

You can use CoordinateTransform to change coordinates to Cartesian and then use ParametricPlot3D to make the plot. cone[r_, θ_] := Evaluate[CoordinateTransform["Spherical" -> "Cartesian", {r, ϕ, θ}] /. ϕ -> π/4] ParametricPlot3D[cone[r, θ], {r, 0, 1}, {θ, 0, 2. π}] This gives


8

All the other three solutions use ContourPlot. Here's a solution using PolarPlot. PolarPlot[{ArcCos[#2^2/(3 π/4)^2] + 2 π #1, -ArcCos[#2^2/(3 π/4)^2] + 2 π (#1 + 1)} & @@ QuotientRemainder[Abs@ θ, 2 π], {θ, -7 π, 8 π}, PlotStyle -> {Thick, Darker@Green}] This makes use of the fact that the solution to $\theta^2=\displaystyle\left(\frac{3\...


7

Does this work for you: PolarPlot[{ArcCos[t], -ArcCos[t]}, {t, -1,1}] Update: (Sjoerd C. de Vries comment) For all r r=(+/-)ArcCos[t]+2 n Pi Taking few of r results: Show[Table[ PolarPlot[{ArcCos[t], -ArcCos[t]} + n 2 Pi, {t, -1, 1}, PlotRange -> All], {n, -10, 10}]]


7

Update: An alternative approach is to use ChartElementFunction: Histogram[data, Automatic, "Probability", ChartStyle -> "Rainbow", ChartElementFunction -> (ChartElementDataFunction["GlassRectangle"][1 + #, ##2] &), AxesOrigin -> {-3, 1}, PlotRange -> All] Original post: SeedRandom[1]; data = RandomVariate[NormalDistribution[], 100]; hist ...


7

The explanation is that the result is not quite in polar coordinates. The first and second elements of the result vector are not the length and angle of the vector. This is not how they must be interpreted, with an $r$ and $\theta$ coordinate: Instead they are the coefficients of a radial and tangential unit vectors at the given point: $\mathbf{e}_r$ and $...


7

You can always impose this constraint with the option RegionFunction: PolarPlot[Sin[θ] Cos[θ], {θ, 0, 2π}] PolarPlot[Sin[θ] Cos[θ], {θ, 0, 2π}, RegionFunction -> Function[{x, y, θ, r}, r > 0]]


Only top voted, non community-wiki answers of a minimum length are eligible