How to ternary Plot3D a function Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?How to plot ternary density plots?Where can I get detailed information on how the Plot command works?How to plot a barycentric lineHow to add a common color legend to a grid of density plots?How to plot ternary density plots?Extending a ternary plot to a tetrahedron (using ListPlot)Mysterious spikes in Plot3DHow to plot the following print?How to plot a region defined by corner pointsDifferent Mesh color in multiple Plot3DMake Plot3D only the real values of a functionGraphic representation of a triangle using ArrayPlot
What *exactly* is electrical current, voltage, and resistance?
Who's this lady in the war room?
Should man-made satellites feature an intelligent inverted "cow catcher"?
“Since the train was delayed for more than an hour, passengers were given a full refund.” – Why is there no article before “passengers”?
Sorting the characters in a utf-16 string in java
How to leave only the following strings?
How is an IPA symbol that lacks a name (e.g. ɲ) called?
Why does BitLocker not use RSA?
When does Bran Stark remember Jamie pushing him?
Why does my GNOME settings mention "Moto C Plus"?
Is there a verb for listening stealthily?
Proving inequality for positive definite matrix
Why not use the yoke to control yaw, as well as pitch and roll?
Assertions In A Mock Callout Test
Does Prince Arnaud cause someone holding the Princess to lose?
How to mute a string and play another at the same time
When speaking, how do you change your mind mid-sentence?
Why aren't road bike wheels tiny?
Putting Ant-Man on house arrest
Lights are flickering on and off after accidentally bumping into light switch
tabularx column has extra padding at right?
Providing direct feedback to a product salesperson
Is it OK if I do not take the receipt in Germany?
If gravity precedes the formation of a solar system, where did the mass come from that caused the gravity?
How to ternary Plot3D a function
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?How to plot ternary density plots?Where can I get detailed information on how the Plot command works?How to plot a barycentric lineHow to add a common color legend to a grid of density plots?How to plot ternary density plots?Extending a ternary plot to a tetrahedron (using ListPlot)Mysterious spikes in Plot3DHow to plot the following print?How to plot a region defined by corner pointsDifferent Mesh color in multiple Plot3DMake Plot3D only the real values of a functionGraphic representation of a triangle using ArrayPlot
$begingroup$
I ploted 3D the function Sin[A/2]Sin[B/2]Sin[C/2]
with A, B, C > 0
and A + B + C = Pi
.
A basic approach in the post How to plot ternary density plots answers with the use of FindGeometricTransform
. How can I transform the Plot3D
ed function inside the equilateral triangle with FindGeometricTransform
? If there is a simpler method, I would like to know it.
plotting
New contributor
$endgroup$
add a comment |
$begingroup$
I ploted 3D the function Sin[A/2]Sin[B/2]Sin[C/2]
with A, B, C > 0
and A + B + C = Pi
.
A basic approach in the post How to plot ternary density plots answers with the use of FindGeometricTransform
. How can I transform the Plot3D
ed function inside the equilateral triangle with FindGeometricTransform
? If there is a simpler method, I would like to know it.
plotting
New contributor
$endgroup$
$begingroup$
I can make ternary density plots and ternary contour plots according to the post above. But I would like to draw 3D plots with one of the point in the equilateral triangle as the coordinates. The coordinates are essentially 2 dimensional with A + B + C = Pi
$endgroup$
– seiichikiri
2 days ago
$begingroup$
If you want to clarify the question further, you can click the edit button in the left-bottom corner of your question .
$endgroup$
– xzczd
2 days ago
$begingroup$
Welcome to Mathematica.SE, seiichikiri! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour and check the faqs! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign!
$endgroup$
– Chris K
yesterday
add a comment |
$begingroup$
I ploted 3D the function Sin[A/2]Sin[B/2]Sin[C/2]
with A, B, C > 0
and A + B + C = Pi
.
A basic approach in the post How to plot ternary density plots answers with the use of FindGeometricTransform
. How can I transform the Plot3D
ed function inside the equilateral triangle with FindGeometricTransform
? If there is a simpler method, I would like to know it.
plotting
New contributor
$endgroup$
I ploted 3D the function Sin[A/2]Sin[B/2]Sin[C/2]
with A, B, C > 0
and A + B + C = Pi
.
A basic approach in the post How to plot ternary density plots answers with the use of FindGeometricTransform
. How can I transform the Plot3D
ed function inside the equilateral triangle with FindGeometricTransform
? If there is a simpler method, I would like to know it.
plotting
plotting
New contributor
New contributor
edited 2 days ago
xzczd
27.8k576258
27.8k576258
New contributor
asked 2 days ago
seiichikiriseiichikiri
282
282
New contributor
New contributor
$begingroup$
I can make ternary density plots and ternary contour plots according to the post above. But I would like to draw 3D plots with one of the point in the equilateral triangle as the coordinates. The coordinates are essentially 2 dimensional with A + B + C = Pi
$endgroup$
– seiichikiri
2 days ago
$begingroup$
If you want to clarify the question further, you can click the edit button in the left-bottom corner of your question .
$endgroup$
– xzczd
2 days ago
$begingroup$
Welcome to Mathematica.SE, seiichikiri! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour and check the faqs! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign!
$endgroup$
– Chris K
yesterday
add a comment |
$begingroup$
I can make ternary density plots and ternary contour plots according to the post above. But I would like to draw 3D plots with one of the point in the equilateral triangle as the coordinates. The coordinates are essentially 2 dimensional with A + B + C = Pi
$endgroup$
– seiichikiri
2 days ago
$begingroup$
If you want to clarify the question further, you can click the edit button in the left-bottom corner of your question .
$endgroup$
– xzczd
2 days ago
$begingroup$
Welcome to Mathematica.SE, seiichikiri! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour and check the faqs! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign!
$endgroup$
– Chris K
yesterday
$begingroup$
I can make ternary density plots and ternary contour plots according to the post above. But I would like to draw 3D plots with one of the point in the equilateral triangle as the coordinates. The coordinates are essentially 2 dimensional with A + B + C = Pi
$endgroup$
– seiichikiri
2 days ago
$begingroup$
I can make ternary density plots and ternary contour plots according to the post above. But I would like to draw 3D plots with one of the point in the equilateral triangle as the coordinates. The coordinates are essentially 2 dimensional with A + B + C = Pi
$endgroup$
– seiichikiri
2 days ago
$begingroup$
If you want to clarify the question further, you can click the edit button in the left-bottom corner of your question .
$endgroup$
– xzczd
2 days ago
$begingroup$
If you want to clarify the question further, you can click the edit button in the left-bottom corner of your question .
$endgroup$
– xzczd
2 days ago
$begingroup$
Welcome to Mathematica.SE, seiichikiri! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour and check the faqs! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign!
$endgroup$
– Chris K
yesterday
$begingroup$
Welcome to Mathematica.SE, seiichikiri! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour and check the faqs! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign!
$endgroup$
– Chris K
yesterday
add a comment |
3 Answers
3
active
oldest
votes
$begingroup$
It's not hard to transform the Graphics3D
generated by Plot3D
if you understand its structure. We already have numbers of posts about this issue so I'd like not to talk about it in this answer, you may check e.g. this post for more info. Here comes the code, notice I've made use of the new-in-v12 feature of Callout
to create ticks, which is more troublesome compared to the transforming part in my opinion:
old = Pi First@Triangle[]
begin = ##, 0 & @@@ (π AnglePath[0, 120 °, 120 °])
direction = Normalize /@ Differences@begin;
p3 = Plot3D[Sin[a/2] Sin[b/2] Sin[(Pi - a - b)/2], a, b ∈ Triangle@old];
error, tr = FindGeometricTransform[Most /@ Most@begin, old];
newp3 = p3 /.
GraphicsComplex[pts_, rest__] :>GraphicsComplex[SubsetMap[tr, #, 1, 2] & /@ pts, rest];
ticks = ListPointPlot3D@Flatten@With[n = 5,
Table[Callout[begin[[i]] + direction[[i]] j Pi/n, j Pi/n], i, 3, j, 0, n]];
Show[newp3, ticks, Axes -> False, Boxed -> False, PlotRange -> All]
Hmm… the result doesn't look that great on Wolfram cloud, perhaps it'll be better on Mathematica Desktop?
$endgroup$
$begingroup$
My intension is to compare LHS and RHS of the inequalities. In this case, 6r/R = 24 Sin[A/2]Sin[B/2]Sin[C/2] <= CyclicSum (Sin[A]+Sin[B])/Cot[C/2], where r is the incenter and circumcenter of a triangle. I deleted 3rd line and 7th line. I replaced 6th line by newp3 = p3/. GraphicsComplex[pts_,rest_] -> GraphicsComplex[Map[tr, #,1,2]&/@pts,rest]. Is this change allowable? My version of Mathematica 8 does not include SubsetMap. I could plot similar figures as yours. But the base of the plot is isosceles, not equilateral. I found this by rotation.
$endgroup$
– seiichikiri
2 days ago
$begingroup$
@seiichikiri No, your usage ofMap[...]
is incorrect. It should be e.g.newp3 = p3 /. GraphicsComplex[pts_, rest__] :> GraphicsComplex[Join[tr[#, #2], #3] & @@@ pts, rest]
. The shape of triangle looks incorrect because I've addedPlotRange -> All
and the defaultBoxRatios
is1, 1, 0.4
in this case.
$endgroup$
– xzczd
yesterday
$begingroup$
@xzcxd I obtained what I wanted. Thank you very much!
$endgroup$
– seiichikiri
yesterday
$begingroup$
@seiichikiri Glad it help. If my answer resolves your problem, you can accept it by clicking the checkmark sign.
$endgroup$
– xzczd
yesterday
add a comment |
$begingroup$
Without using any transformations, you have
$$
A = frac13 - x - fracysqrt3\
B = frac13 + x - fracysqrt3\
C = frac13 + frac2 ysqrt3
$$
In this form, they span the ranges $[0,1]$ over an equilateral triangle with unit edges, and satisfy $A+B+C=1$. In what follows I'll use $a$, $b$, $c$ instead of the capital letters because it's not a good idea to use capital letters for your own definitions in Mathematica.
Plotting your function, you need to multiply these with $pi$ to get your desired range.
Here's a very simplistic way of plotting that does not generate any tick marks. It is mostly for getting a quick overview. If you want proper tick marks you need to follow some of the other recommendations, for example on question 39733. Also, MeshFunctions
can give interesting meshes when combined with the effective coordinates $a$, $b$, $c$.
f[a_, b_, c_] = Sin[π*a/2] Sin[π*b/2] Sin[π*c/2];
DensityPlot[f[1/3-x-y/Sqrt[3], 1/3+x-y/Sqrt[3], 1/3+2y/Sqrt[3]],
x, -0.6, 0.6, y, -0.4, 0.7,
RegionFunction -> Function[x, y, 0<=1/3-x-y/Sqrt[3]<=1 && 0<=1/3+x-y/Sqrt[3]<=1 && 0<=1/3+2y/Sqrt[3]<=1],
AspectRatio -> Automatic,
Epilog -> Text["A", -1/2, -1/(2 Sqrt[3]), Sqrt[3]/2, 1/2],
Text["B", 1/2, -1/(2 Sqrt[3]), -Sqrt[3]/2, 1/2],
Text["C", 0, 1/Sqrt[3], 0, -1]]
Here is what happens if we set the function $f(a,b,c)$ to either $a$, $b$, or $c$: you can see the behavior of these coordinates,
$endgroup$
add a comment |
$begingroup$
DensityPlot3D[Sin[a/2] Sin[b/2] Sin[c/2],
a, 0, 2, b, 0, 2, c, 0, 2]
$endgroup$
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "387"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
seiichikiri is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f195633%2fhow-to-ternary-plot3d-a-function%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
It's not hard to transform the Graphics3D
generated by Plot3D
if you understand its structure. We already have numbers of posts about this issue so I'd like not to talk about it in this answer, you may check e.g. this post for more info. Here comes the code, notice I've made use of the new-in-v12 feature of Callout
to create ticks, which is more troublesome compared to the transforming part in my opinion:
old = Pi First@Triangle[]
begin = ##, 0 & @@@ (π AnglePath[0, 120 °, 120 °])
direction = Normalize /@ Differences@begin;
p3 = Plot3D[Sin[a/2] Sin[b/2] Sin[(Pi - a - b)/2], a, b ∈ Triangle@old];
error, tr = FindGeometricTransform[Most /@ Most@begin, old];
newp3 = p3 /.
GraphicsComplex[pts_, rest__] :>GraphicsComplex[SubsetMap[tr, #, 1, 2] & /@ pts, rest];
ticks = ListPointPlot3D@Flatten@With[n = 5,
Table[Callout[begin[[i]] + direction[[i]] j Pi/n, j Pi/n], i, 3, j, 0, n]];
Show[newp3, ticks, Axes -> False, Boxed -> False, PlotRange -> All]
Hmm… the result doesn't look that great on Wolfram cloud, perhaps it'll be better on Mathematica Desktop?
$endgroup$
$begingroup$
My intension is to compare LHS and RHS of the inequalities. In this case, 6r/R = 24 Sin[A/2]Sin[B/2]Sin[C/2] <= CyclicSum (Sin[A]+Sin[B])/Cot[C/2], where r is the incenter and circumcenter of a triangle. I deleted 3rd line and 7th line. I replaced 6th line by newp3 = p3/. GraphicsComplex[pts_,rest_] -> GraphicsComplex[Map[tr, #,1,2]&/@pts,rest]. Is this change allowable? My version of Mathematica 8 does not include SubsetMap. I could plot similar figures as yours. But the base of the plot is isosceles, not equilateral. I found this by rotation.
$endgroup$
– seiichikiri
2 days ago
$begingroup$
@seiichikiri No, your usage ofMap[...]
is incorrect. It should be e.g.newp3 = p3 /. GraphicsComplex[pts_, rest__] :> GraphicsComplex[Join[tr[#, #2], #3] & @@@ pts, rest]
. The shape of triangle looks incorrect because I've addedPlotRange -> All
and the defaultBoxRatios
is1, 1, 0.4
in this case.
$endgroup$
– xzczd
yesterday
$begingroup$
@xzcxd I obtained what I wanted. Thank you very much!
$endgroup$
– seiichikiri
yesterday
$begingroup$
@seiichikiri Glad it help. If my answer resolves your problem, you can accept it by clicking the checkmark sign.
$endgroup$
– xzczd
yesterday
add a comment |
$begingroup$
It's not hard to transform the Graphics3D
generated by Plot3D
if you understand its structure. We already have numbers of posts about this issue so I'd like not to talk about it in this answer, you may check e.g. this post for more info. Here comes the code, notice I've made use of the new-in-v12 feature of Callout
to create ticks, which is more troublesome compared to the transforming part in my opinion:
old = Pi First@Triangle[]
begin = ##, 0 & @@@ (π AnglePath[0, 120 °, 120 °])
direction = Normalize /@ Differences@begin;
p3 = Plot3D[Sin[a/2] Sin[b/2] Sin[(Pi - a - b)/2], a, b ∈ Triangle@old];
error, tr = FindGeometricTransform[Most /@ Most@begin, old];
newp3 = p3 /.
GraphicsComplex[pts_, rest__] :>GraphicsComplex[SubsetMap[tr, #, 1, 2] & /@ pts, rest];
ticks = ListPointPlot3D@Flatten@With[n = 5,
Table[Callout[begin[[i]] + direction[[i]] j Pi/n, j Pi/n], i, 3, j, 0, n]];
Show[newp3, ticks, Axes -> False, Boxed -> False, PlotRange -> All]
Hmm… the result doesn't look that great on Wolfram cloud, perhaps it'll be better on Mathematica Desktop?
$endgroup$
$begingroup$
My intension is to compare LHS and RHS of the inequalities. In this case, 6r/R = 24 Sin[A/2]Sin[B/2]Sin[C/2] <= CyclicSum (Sin[A]+Sin[B])/Cot[C/2], where r is the incenter and circumcenter of a triangle. I deleted 3rd line and 7th line. I replaced 6th line by newp3 = p3/. GraphicsComplex[pts_,rest_] -> GraphicsComplex[Map[tr, #,1,2]&/@pts,rest]. Is this change allowable? My version of Mathematica 8 does not include SubsetMap. I could plot similar figures as yours. But the base of the plot is isosceles, not equilateral. I found this by rotation.
$endgroup$
– seiichikiri
2 days ago
$begingroup$
@seiichikiri No, your usage ofMap[...]
is incorrect. It should be e.g.newp3 = p3 /. GraphicsComplex[pts_, rest__] :> GraphicsComplex[Join[tr[#, #2], #3] & @@@ pts, rest]
. The shape of triangle looks incorrect because I've addedPlotRange -> All
and the defaultBoxRatios
is1, 1, 0.4
in this case.
$endgroup$
– xzczd
yesterday
$begingroup$
@xzcxd I obtained what I wanted. Thank you very much!
$endgroup$
– seiichikiri
yesterday
$begingroup$
@seiichikiri Glad it help. If my answer resolves your problem, you can accept it by clicking the checkmark sign.
$endgroup$
– xzczd
yesterday
add a comment |
$begingroup$
It's not hard to transform the Graphics3D
generated by Plot3D
if you understand its structure. We already have numbers of posts about this issue so I'd like not to talk about it in this answer, you may check e.g. this post for more info. Here comes the code, notice I've made use of the new-in-v12 feature of Callout
to create ticks, which is more troublesome compared to the transforming part in my opinion:
old = Pi First@Triangle[]
begin = ##, 0 & @@@ (π AnglePath[0, 120 °, 120 °])
direction = Normalize /@ Differences@begin;
p3 = Plot3D[Sin[a/2] Sin[b/2] Sin[(Pi - a - b)/2], a, b ∈ Triangle@old];
error, tr = FindGeometricTransform[Most /@ Most@begin, old];
newp3 = p3 /.
GraphicsComplex[pts_, rest__] :>GraphicsComplex[SubsetMap[tr, #, 1, 2] & /@ pts, rest];
ticks = ListPointPlot3D@Flatten@With[n = 5,
Table[Callout[begin[[i]] + direction[[i]] j Pi/n, j Pi/n], i, 3, j, 0, n]];
Show[newp3, ticks, Axes -> False, Boxed -> False, PlotRange -> All]
Hmm… the result doesn't look that great on Wolfram cloud, perhaps it'll be better on Mathematica Desktop?
$endgroup$
It's not hard to transform the Graphics3D
generated by Plot3D
if you understand its structure. We already have numbers of posts about this issue so I'd like not to talk about it in this answer, you may check e.g. this post for more info. Here comes the code, notice I've made use of the new-in-v12 feature of Callout
to create ticks, which is more troublesome compared to the transforming part in my opinion:
old = Pi First@Triangle[]
begin = ##, 0 & @@@ (π AnglePath[0, 120 °, 120 °])
direction = Normalize /@ Differences@begin;
p3 = Plot3D[Sin[a/2] Sin[b/2] Sin[(Pi - a - b)/2], a, b ∈ Triangle@old];
error, tr = FindGeometricTransform[Most /@ Most@begin, old];
newp3 = p3 /.
GraphicsComplex[pts_, rest__] :>GraphicsComplex[SubsetMap[tr, #, 1, 2] & /@ pts, rest];
ticks = ListPointPlot3D@Flatten@With[n = 5,
Table[Callout[begin[[i]] + direction[[i]] j Pi/n, j Pi/n], i, 3, j, 0, n]];
Show[newp3, ticks, Axes -> False, Boxed -> False, PlotRange -> All]
Hmm… the result doesn't look that great on Wolfram cloud, perhaps it'll be better on Mathematica Desktop?
edited yesterday
answered 2 days ago
xzczdxzczd
27.8k576258
27.8k576258
$begingroup$
My intension is to compare LHS and RHS of the inequalities. In this case, 6r/R = 24 Sin[A/2]Sin[B/2]Sin[C/2] <= CyclicSum (Sin[A]+Sin[B])/Cot[C/2], where r is the incenter and circumcenter of a triangle. I deleted 3rd line and 7th line. I replaced 6th line by newp3 = p3/. GraphicsComplex[pts_,rest_] -> GraphicsComplex[Map[tr, #,1,2]&/@pts,rest]. Is this change allowable? My version of Mathematica 8 does not include SubsetMap. I could plot similar figures as yours. But the base of the plot is isosceles, not equilateral. I found this by rotation.
$endgroup$
– seiichikiri
2 days ago
$begingroup$
@seiichikiri No, your usage ofMap[...]
is incorrect. It should be e.g.newp3 = p3 /. GraphicsComplex[pts_, rest__] :> GraphicsComplex[Join[tr[#, #2], #3] & @@@ pts, rest]
. The shape of triangle looks incorrect because I've addedPlotRange -> All
and the defaultBoxRatios
is1, 1, 0.4
in this case.
$endgroup$
– xzczd
yesterday
$begingroup$
@xzcxd I obtained what I wanted. Thank you very much!
$endgroup$
– seiichikiri
yesterday
$begingroup$
@seiichikiri Glad it help. If my answer resolves your problem, you can accept it by clicking the checkmark sign.
$endgroup$
– xzczd
yesterday
add a comment |
$begingroup$
My intension is to compare LHS and RHS of the inequalities. In this case, 6r/R = 24 Sin[A/2]Sin[B/2]Sin[C/2] <= CyclicSum (Sin[A]+Sin[B])/Cot[C/2], where r is the incenter and circumcenter of a triangle. I deleted 3rd line and 7th line. I replaced 6th line by newp3 = p3/. GraphicsComplex[pts_,rest_] -> GraphicsComplex[Map[tr, #,1,2]&/@pts,rest]. Is this change allowable? My version of Mathematica 8 does not include SubsetMap. I could plot similar figures as yours. But the base of the plot is isosceles, not equilateral. I found this by rotation.
$endgroup$
– seiichikiri
2 days ago
$begingroup$
@seiichikiri No, your usage ofMap[...]
is incorrect. It should be e.g.newp3 = p3 /. GraphicsComplex[pts_, rest__] :> GraphicsComplex[Join[tr[#, #2], #3] & @@@ pts, rest]
. The shape of triangle looks incorrect because I've addedPlotRange -> All
and the defaultBoxRatios
is1, 1, 0.4
in this case.
$endgroup$
– xzczd
yesterday
$begingroup$
@xzcxd I obtained what I wanted. Thank you very much!
$endgroup$
– seiichikiri
yesterday
$begingroup$
@seiichikiri Glad it help. If my answer resolves your problem, you can accept it by clicking the checkmark sign.
$endgroup$
– xzczd
yesterday
$begingroup$
My intension is to compare LHS and RHS of the inequalities. In this case, 6r/R = 24 Sin[A/2]Sin[B/2]Sin[C/2] <= CyclicSum (Sin[A]+Sin[B])/Cot[C/2], where r is the incenter and circumcenter of a triangle. I deleted 3rd line and 7th line. I replaced 6th line by newp3 = p3/. GraphicsComplex[pts_,rest_] -> GraphicsComplex[Map[tr, #,1,2]&/@pts,rest]. Is this change allowable? My version of Mathematica 8 does not include SubsetMap. I could plot similar figures as yours. But the base of the plot is isosceles, not equilateral. I found this by rotation.
$endgroup$
– seiichikiri
2 days ago
$begingroup$
My intension is to compare LHS and RHS of the inequalities. In this case, 6r/R = 24 Sin[A/2]Sin[B/2]Sin[C/2] <= CyclicSum (Sin[A]+Sin[B])/Cot[C/2], where r is the incenter and circumcenter of a triangle. I deleted 3rd line and 7th line. I replaced 6th line by newp3 = p3/. GraphicsComplex[pts_,rest_] -> GraphicsComplex[Map[tr, #,1,2]&/@pts,rest]. Is this change allowable? My version of Mathematica 8 does not include SubsetMap. I could plot similar figures as yours. But the base of the plot is isosceles, not equilateral. I found this by rotation.
$endgroup$
– seiichikiri
2 days ago
$begingroup$
@seiichikiri No, your usage of
Map[...]
is incorrect. It should be e.g. newp3 = p3 /. GraphicsComplex[pts_, rest__] :> GraphicsComplex[Join[tr[#, #2], #3] & @@@ pts, rest]
. The shape of triangle looks incorrect because I've added PlotRange -> All
and the default BoxRatios
is 1, 1, 0.4
in this case.$endgroup$
– xzczd
yesterday
$begingroup$
@seiichikiri No, your usage of
Map[...]
is incorrect. It should be e.g. newp3 = p3 /. GraphicsComplex[pts_, rest__] :> GraphicsComplex[Join[tr[#, #2], #3] & @@@ pts, rest]
. The shape of triangle looks incorrect because I've added PlotRange -> All
and the default BoxRatios
is 1, 1, 0.4
in this case.$endgroup$
– xzczd
yesterday
$begingroup$
@xzcxd I obtained what I wanted. Thank you very much!
$endgroup$
– seiichikiri
yesterday
$begingroup$
@xzcxd I obtained what I wanted. Thank you very much!
$endgroup$
– seiichikiri
yesterday
$begingroup$
@seiichikiri Glad it help. If my answer resolves your problem, you can accept it by clicking the checkmark sign.
$endgroup$
– xzczd
yesterday
$begingroup$
@seiichikiri Glad it help. If my answer resolves your problem, you can accept it by clicking the checkmark sign.
$endgroup$
– xzczd
yesterday
add a comment |
$begingroup$
Without using any transformations, you have
$$
A = frac13 - x - fracysqrt3\
B = frac13 + x - fracysqrt3\
C = frac13 + frac2 ysqrt3
$$
In this form, they span the ranges $[0,1]$ over an equilateral triangle with unit edges, and satisfy $A+B+C=1$. In what follows I'll use $a$, $b$, $c$ instead of the capital letters because it's not a good idea to use capital letters for your own definitions in Mathematica.
Plotting your function, you need to multiply these with $pi$ to get your desired range.
Here's a very simplistic way of plotting that does not generate any tick marks. It is mostly for getting a quick overview. If you want proper tick marks you need to follow some of the other recommendations, for example on question 39733. Also, MeshFunctions
can give interesting meshes when combined with the effective coordinates $a$, $b$, $c$.
f[a_, b_, c_] = Sin[π*a/2] Sin[π*b/2] Sin[π*c/2];
DensityPlot[f[1/3-x-y/Sqrt[3], 1/3+x-y/Sqrt[3], 1/3+2y/Sqrt[3]],
x, -0.6, 0.6, y, -0.4, 0.7,
RegionFunction -> Function[x, y, 0<=1/3-x-y/Sqrt[3]<=1 && 0<=1/3+x-y/Sqrt[3]<=1 && 0<=1/3+2y/Sqrt[3]<=1],
AspectRatio -> Automatic,
Epilog -> Text["A", -1/2, -1/(2 Sqrt[3]), Sqrt[3]/2, 1/2],
Text["B", 1/2, -1/(2 Sqrt[3]), -Sqrt[3]/2, 1/2],
Text["C", 0, 1/Sqrt[3], 0, -1]]
Here is what happens if we set the function $f(a,b,c)$ to either $a$, $b$, or $c$: you can see the behavior of these coordinates,
$endgroup$
add a comment |
$begingroup$
Without using any transformations, you have
$$
A = frac13 - x - fracysqrt3\
B = frac13 + x - fracysqrt3\
C = frac13 + frac2 ysqrt3
$$
In this form, they span the ranges $[0,1]$ over an equilateral triangle with unit edges, and satisfy $A+B+C=1$. In what follows I'll use $a$, $b$, $c$ instead of the capital letters because it's not a good idea to use capital letters for your own definitions in Mathematica.
Plotting your function, you need to multiply these with $pi$ to get your desired range.
Here's a very simplistic way of plotting that does not generate any tick marks. It is mostly for getting a quick overview. If you want proper tick marks you need to follow some of the other recommendations, for example on question 39733. Also, MeshFunctions
can give interesting meshes when combined with the effective coordinates $a$, $b$, $c$.
f[a_, b_, c_] = Sin[π*a/2] Sin[π*b/2] Sin[π*c/2];
DensityPlot[f[1/3-x-y/Sqrt[3], 1/3+x-y/Sqrt[3], 1/3+2y/Sqrt[3]],
x, -0.6, 0.6, y, -0.4, 0.7,
RegionFunction -> Function[x, y, 0<=1/3-x-y/Sqrt[3]<=1 && 0<=1/3+x-y/Sqrt[3]<=1 && 0<=1/3+2y/Sqrt[3]<=1],
AspectRatio -> Automatic,
Epilog -> Text["A", -1/2, -1/(2 Sqrt[3]), Sqrt[3]/2, 1/2],
Text["B", 1/2, -1/(2 Sqrt[3]), -Sqrt[3]/2, 1/2],
Text["C", 0, 1/Sqrt[3], 0, -1]]
Here is what happens if we set the function $f(a,b,c)$ to either $a$, $b$, or $c$: you can see the behavior of these coordinates,
$endgroup$
add a comment |
$begingroup$
Without using any transformations, you have
$$
A = frac13 - x - fracysqrt3\
B = frac13 + x - fracysqrt3\
C = frac13 + frac2 ysqrt3
$$
In this form, they span the ranges $[0,1]$ over an equilateral triangle with unit edges, and satisfy $A+B+C=1$. In what follows I'll use $a$, $b$, $c$ instead of the capital letters because it's not a good idea to use capital letters for your own definitions in Mathematica.
Plotting your function, you need to multiply these with $pi$ to get your desired range.
Here's a very simplistic way of plotting that does not generate any tick marks. It is mostly for getting a quick overview. If you want proper tick marks you need to follow some of the other recommendations, for example on question 39733. Also, MeshFunctions
can give interesting meshes when combined with the effective coordinates $a$, $b$, $c$.
f[a_, b_, c_] = Sin[π*a/2] Sin[π*b/2] Sin[π*c/2];
DensityPlot[f[1/3-x-y/Sqrt[3], 1/3+x-y/Sqrt[3], 1/3+2y/Sqrt[3]],
x, -0.6, 0.6, y, -0.4, 0.7,
RegionFunction -> Function[x, y, 0<=1/3-x-y/Sqrt[3]<=1 && 0<=1/3+x-y/Sqrt[3]<=1 && 0<=1/3+2y/Sqrt[3]<=1],
AspectRatio -> Automatic,
Epilog -> Text["A", -1/2, -1/(2 Sqrt[3]), Sqrt[3]/2, 1/2],
Text["B", 1/2, -1/(2 Sqrt[3]), -Sqrt[3]/2, 1/2],
Text["C", 0, 1/Sqrt[3], 0, -1]]
Here is what happens if we set the function $f(a,b,c)$ to either $a$, $b$, or $c$: you can see the behavior of these coordinates,
$endgroup$
Without using any transformations, you have
$$
A = frac13 - x - fracysqrt3\
B = frac13 + x - fracysqrt3\
C = frac13 + frac2 ysqrt3
$$
In this form, they span the ranges $[0,1]$ over an equilateral triangle with unit edges, and satisfy $A+B+C=1$. In what follows I'll use $a$, $b$, $c$ instead of the capital letters because it's not a good idea to use capital letters for your own definitions in Mathematica.
Plotting your function, you need to multiply these with $pi$ to get your desired range.
Here's a very simplistic way of plotting that does not generate any tick marks. It is mostly for getting a quick overview. If you want proper tick marks you need to follow some of the other recommendations, for example on question 39733. Also, MeshFunctions
can give interesting meshes when combined with the effective coordinates $a$, $b$, $c$.
f[a_, b_, c_] = Sin[π*a/2] Sin[π*b/2] Sin[π*c/2];
DensityPlot[f[1/3-x-y/Sqrt[3], 1/3+x-y/Sqrt[3], 1/3+2y/Sqrt[3]],
x, -0.6, 0.6, y, -0.4, 0.7,
RegionFunction -> Function[x, y, 0<=1/3-x-y/Sqrt[3]<=1 && 0<=1/3+x-y/Sqrt[3]<=1 && 0<=1/3+2y/Sqrt[3]<=1],
AspectRatio -> Automatic,
Epilog -> Text["A", -1/2, -1/(2 Sqrt[3]), Sqrt[3]/2, 1/2],
Text["B", 1/2, -1/(2 Sqrt[3]), -Sqrt[3]/2, 1/2],
Text["C", 0, 1/Sqrt[3], 0, -1]]
Here is what happens if we set the function $f(a,b,c)$ to either $a$, $b$, or $c$: you can see the behavior of these coordinates,
edited 2 days ago
answered 2 days ago
RomanRoman
5,98111132
5,98111132
add a comment |
add a comment |
$begingroup$
DensityPlot3D[Sin[a/2] Sin[b/2] Sin[c/2],
a, 0, 2, b, 0, 2, c, 0, 2]
$endgroup$
add a comment |
$begingroup$
DensityPlot3D[Sin[a/2] Sin[b/2] Sin[c/2],
a, 0, 2, b, 0, 2, c, 0, 2]
$endgroup$
add a comment |
$begingroup$
DensityPlot3D[Sin[a/2] Sin[b/2] Sin[c/2],
a, 0, 2, b, 0, 2, c, 0, 2]
$endgroup$
DensityPlot3D[Sin[a/2] Sin[b/2] Sin[c/2],
a, 0, 2, b, 0, 2, c, 0, 2]
answered 2 days ago
David G. StorkDavid G. Stork
24.9k22155
24.9k22155
add a comment |
add a comment |
seiichikiri is a new contributor. Be nice, and check out our Code of Conduct.
seiichikiri is a new contributor. Be nice, and check out our Code of Conduct.
seiichikiri is a new contributor. Be nice, and check out our Code of Conduct.
seiichikiri is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Mathematica Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f195633%2fhow-to-ternary-plot3d-a-function%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
$begingroup$
I can make ternary density plots and ternary contour plots according to the post above. But I would like to draw 3D plots with one of the point in the equilateral triangle as the coordinates. The coordinates are essentially 2 dimensional with A + B + C = Pi
$endgroup$
– seiichikiri
2 days ago
$begingroup$
If you want to clarify the question further, you can click the edit button in the left-bottom corner of your question .
$endgroup$
– xzczd
2 days ago
$begingroup$
Welcome to Mathematica.SE, seiichikiri! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour and check the faqs! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign!
$endgroup$
– Chris K
yesterday