59

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[ "...


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 ...


15

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 ...


14

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, ...


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 ...


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

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

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}}}, ...


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.


10

This appears to be a lid driven flow problem. I am in agreement with @user21's perspective that you should solve this in Cartesian Coordinates. It should simplify the boundary condition specification. Since the system is closed, you will need to define pressure at a node. I used OpenCascade to build the half cylinder. Here is the workflow. (* Load ...


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

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

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

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

Basing on the following thread: Change variables in differential expressions and using great code by Jens for visualisation purposes (I have replaced part [vars__Symbol] with [vars__] because you are using Substripted names which are not Symbols, but that's only about visualisation). You can do the following in the first step: M2 = M /. f -> (f[#, #2, #...


8

The workflow can be made easier using the FindGeometricTransform function. First we find 4 points on the original image that defines a rectangle in the undistorted image. This can be done easily using the "Get Coordinates" in the tool. pts1 = {{616.597, 569.06}, {634.702, 685.615}, {916.721, 681.76}, {930.127, 566.84}}; We want to map this rectangle in ...


8

I'm afraid your approach is flawed. SphericalPlot3D[r,t,p] plots r[t,p], where t and p are assuming to be independent spherical angles. But you don't want t and p to be independent, you want them to be functions of oblate spheroidal coordinates. (Incidentally, this is also why you're getting spheres in your last version: you're telling it to plot r==...


8

Mathematica's answer is correct and consistent with your expectations, but you are not accounting for the basis of the vector field. TransformedField transforms a vector field between two coordinate systems and bases. In this case, it is converting from $f(x,y)\hat x+g(x,y)\hat y$ to the same geometrical vector field expressed as $u(r,\theta)\hat r + v(r,\...


8

Using MeshFunctions and Mesh in a ParametricPlot of polar coordinates to define the contours: cValues = {0.00001, 0.01, 0.05, 0.1, 0.3, 0.6, 1.0, 1.5, 2.0, 2.5, 3.2}; Block[{a = 1}, ParametricPlot[r {Cos[\[Theta]], Sin[\[Theta]]}, {r, 0, 3 a}, {\[Theta], 0, 2 Pi}, PlotStyle -> None, BoundaryStyle -> None, PlotPoints -> {60, 120}, ...


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 $...


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