Animating wave motion in waterObtaining a 3D animation as a drop in a liquid surfaceAnimating mathematica.se logoAnimating arrowsAnimating labelsHow to animate a propagating wave?Animating Boundary ElementsImporting and animating imagesNot getting smooth motion when animating a 3D plot (with jumps in rotation)Animating with changeable parametersAnimating a mechanical armAnimating point

Should a narrator ever describe things based on a characters view instead of fact?

Exit shell with shortcut (not typing exit) that closes session properly

What are the rules for concealing thieves' tools (or items in general)?

Is VPN a layer 3 concept?

Hackerrank All Women's Codesprint 2019: Name the Product

Have the tides ever turned twice on any open problem?

DisplayForm problem with pi in FractionBox

When should a starting writer get his own webpage?

Why is indicated airspeed rather than ground speed used during the takeoff roll?

The English Debate

"Marked down as someone wanting to sell shares." What does that mean?

Imaginary part of expression too difficult to calculate

label a part of commutative diagram

Why is "la Gestapo" feminine?

Why I don't get the wanted width of tcbox?

Animating wave motion in water

Turning a hard to access nut?

Do native speakers use "ultima" and "proxima" frequently in spoken English?

Single word to change groups

Hot air balloons as primitive bombers

Print a physical multiplication table

Recursively updating the MLE as new observations stream in

Nested Dynamic SOQL Query

Justification failure in beamer enumerate list



Animating wave motion in water


Obtaining a 3D animation as a drop in a liquid surfaceAnimating mathematica.se logoAnimating arrowsAnimating labelsHow to animate a propagating wave?Animating Boundary ElementsImporting and animating imagesNot getting smooth motion when animating a 3D plot (with jumps in rotation)Animating with changeable parametersAnimating a mechanical armAnimating point













14












$begingroup$


Further to this question I found on MSE, I tried to replicate



enter image description here



from here



this is as far as I got:



fun[a_, b_, c_, x_, y_] := 
Point[#[[1]] + x, #[[2]] + y &[
Part[CirclePoints[360] c,
If[a + b == 360, 360, Mod[a + b, 360]]]]];
tab = With[a = #,
Flatten[Table[
Table[fun[a, 90 + 15 n, 1 - .15 m, -1 + .5 n, -.35 m], m, 0,
10], n, 0, 24], 1]] & /@ Range[1, 360, 15];

Module[t, x, y, fun, xf, yf, a, x = -.5; y = 1;
fun[a_, b_, c_, x_, y_] :=
Point[#[[1]] + x, #[[2]] + y &[
Part[CirclePoints[360] c,
If[a + b == 360, 360, Mod[a + b, 360]]]]];
xf[t_, a_, b_] := a t - b Sin[t]; yf[t_, a_, b_] := a - b Cos[t];
Animate[
Show[
Graphics[
PointSize[.01], tab[[a]],
PlotRange -> -1 - x, 10 + x, -1 - y, 1
],
ParametricPlot[
(Pi/2) xf[t + 2 Pi a/24, 1.25, .6] - 4 Pi a/24 - Pi^2 + .05,
2.05 - 1.65 yf[t + 2 Pi a/24, 1.25, .6],
t, -4 Pi, 4 Pi, Axes -> False
]
],
a, 1, 24, 1, ControlPlacement -> Top, AnimationRate -> 5,
AnimationDirection -> Backward
]
]


which is not very efficient (I'm sure Part could be applied more efficiently), and despite various tweeks, I couldn't quite manage to get the cycloid to line up with the points.



What is a better way to approach this?










share|improve this question











$endgroup$











  • $begingroup$
    See this: mathematica.stackexchange.com/questions/123127/…
    $endgroup$
    – LCarvalho
    14 hours ago















14












$begingroup$


Further to this question I found on MSE, I tried to replicate



enter image description here



from here



this is as far as I got:



fun[a_, b_, c_, x_, y_] := 
Point[#[[1]] + x, #[[2]] + y &[
Part[CirclePoints[360] c,
If[a + b == 360, 360, Mod[a + b, 360]]]]];
tab = With[a = #,
Flatten[Table[
Table[fun[a, 90 + 15 n, 1 - .15 m, -1 + .5 n, -.35 m], m, 0,
10], n, 0, 24], 1]] & /@ Range[1, 360, 15];

Module[t, x, y, fun, xf, yf, a, x = -.5; y = 1;
fun[a_, b_, c_, x_, y_] :=
Point[#[[1]] + x, #[[2]] + y &[
Part[CirclePoints[360] c,
If[a + b == 360, 360, Mod[a + b, 360]]]]];
xf[t_, a_, b_] := a t - b Sin[t]; yf[t_, a_, b_] := a - b Cos[t];
Animate[
Show[
Graphics[
PointSize[.01], tab[[a]],
PlotRange -> -1 - x, 10 + x, -1 - y, 1
],
ParametricPlot[
(Pi/2) xf[t + 2 Pi a/24, 1.25, .6] - 4 Pi a/24 - Pi^2 + .05,
2.05 - 1.65 yf[t + 2 Pi a/24, 1.25, .6],
t, -4 Pi, 4 Pi, Axes -> False
]
],
a, 1, 24, 1, ControlPlacement -> Top, AnimationRate -> 5,
AnimationDirection -> Backward
]
]


which is not very efficient (I'm sure Part could be applied more efficiently), and despite various tweeks, I couldn't quite manage to get the cycloid to line up with the points.



What is a better way to approach this?










share|improve this question











$endgroup$











  • $begingroup$
    See this: mathematica.stackexchange.com/questions/123127/…
    $endgroup$
    – LCarvalho
    14 hours ago













14












14








14


4



$begingroup$


Further to this question I found on MSE, I tried to replicate



enter image description here



from here



this is as far as I got:



fun[a_, b_, c_, x_, y_] := 
Point[#[[1]] + x, #[[2]] + y &[
Part[CirclePoints[360] c,
If[a + b == 360, 360, Mod[a + b, 360]]]]];
tab = With[a = #,
Flatten[Table[
Table[fun[a, 90 + 15 n, 1 - .15 m, -1 + .5 n, -.35 m], m, 0,
10], n, 0, 24], 1]] & /@ Range[1, 360, 15];

Module[t, x, y, fun, xf, yf, a, x = -.5; y = 1;
fun[a_, b_, c_, x_, y_] :=
Point[#[[1]] + x, #[[2]] + y &[
Part[CirclePoints[360] c,
If[a + b == 360, 360, Mod[a + b, 360]]]]];
xf[t_, a_, b_] := a t - b Sin[t]; yf[t_, a_, b_] := a - b Cos[t];
Animate[
Show[
Graphics[
PointSize[.01], tab[[a]],
PlotRange -> -1 - x, 10 + x, -1 - y, 1
],
ParametricPlot[
(Pi/2) xf[t + 2 Pi a/24, 1.25, .6] - 4 Pi a/24 - Pi^2 + .05,
2.05 - 1.65 yf[t + 2 Pi a/24, 1.25, .6],
t, -4 Pi, 4 Pi, Axes -> False
]
],
a, 1, 24, 1, ControlPlacement -> Top, AnimationRate -> 5,
AnimationDirection -> Backward
]
]


which is not very efficient (I'm sure Part could be applied more efficiently), and despite various tweeks, I couldn't quite manage to get the cycloid to line up with the points.



What is a better way to approach this?










share|improve this question











$endgroup$




Further to this question I found on MSE, I tried to replicate



enter image description here



from here



this is as far as I got:



fun[a_, b_, c_, x_, y_] := 
Point[#[[1]] + x, #[[2]] + y &[
Part[CirclePoints[360] c,
If[a + b == 360, 360, Mod[a + b, 360]]]]];
tab = With[a = #,
Flatten[Table[
Table[fun[a, 90 + 15 n, 1 - .15 m, -1 + .5 n, -.35 m], m, 0,
10], n, 0, 24], 1]] & /@ Range[1, 360, 15];

Module[t, x, y, fun, xf, yf, a, x = -.5; y = 1;
fun[a_, b_, c_, x_, y_] :=
Point[#[[1]] + x, #[[2]] + y &[
Part[CirclePoints[360] c,
If[a + b == 360, 360, Mod[a + b, 360]]]]];
xf[t_, a_, b_] := a t - b Sin[t]; yf[t_, a_, b_] := a - b Cos[t];
Animate[
Show[
Graphics[
PointSize[.01], tab[[a]],
PlotRange -> -1 - x, 10 + x, -1 - y, 1
],
ParametricPlot[
(Pi/2) xf[t + 2 Pi a/24, 1.25, .6] - 4 Pi a/24 - Pi^2 + .05,
2.05 - 1.65 yf[t + 2 Pi a/24, 1.25, .6],
t, -4 Pi, 4 Pi, Axes -> False
]
],
a, 1, 24, 1, ControlPlacement -> Top, AnimationRate -> 5,
AnimationDirection -> Backward
]
]


which is not very efficient (I'm sure Part could be applied more efficiently), and despite various tweeks, I couldn't quite manage to get the cycloid to line up with the points.



What is a better way to approach this?







performance-tuning animation






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 12 hours ago









Kuba

106k12208530




106k12208530










asked 15 hours ago









martinmartin

3,98121248




3,98121248











  • $begingroup$
    See this: mathematica.stackexchange.com/questions/123127/…
    $endgroup$
    – LCarvalho
    14 hours ago
















  • $begingroup$
    See this: mathematica.stackexchange.com/questions/123127/…
    $endgroup$
    – LCarvalho
    14 hours ago















$begingroup$
See this: mathematica.stackexchange.com/questions/123127/…
$endgroup$
– LCarvalho
14 hours ago




$begingroup$
See this: mathematica.stackexchange.com/questions/123127/…
$endgroup$
– LCarvalho
14 hours ago










1 Answer
1






active

oldest

votes


















21












$begingroup$

DynamicModule[t = 0, d = 5, a = .08, base, distortion, pts, r, f, n = 10,

r[y_] := .08 y^4;
f[x_] := -2 Pi Dynamic[t] + d x;
(*f does not evaluate to a number but FE will take care of that later*)

base = Array[List, n 3, 1, 0, Pi, 0, 1 ];

distortion = Array[
Function[x, y, r[y] Cos @ f @ x, Sin @ f @ x], n 3, 1, 0, Pi, 0, 1
];

pts = base + distortion;

Row[
Animator[Dynamic @ t, AnimationRate -> .8, AppearanceElements -> ],
Graphics[
LightBlue,
Polygon @ Join[ pts[[;; , -1]], Scaled[1, 0], Scaled[0, 0]],

Darker @ Blue, AbsolutePointSize @ 5, Point @ Catenate @ pts,

AbsolutePointSize @ 7, Orange, Thick,
Point @ pts[[15, -1]], Circle[base[[15, -1]], r @ base[[15, -1, 2]]],
Point @ pts[[15, 7]], Circle[base[[15, 7]], r @ base[[15, 7, 2]]]
,
PlotRange -> 0 + .1, Pi - .1, 0, 1.2,
PlotRangePadding -> 0,
PlotRangeClipping -> True, ImageSize -> 800]
]
]


enter image description here






share|improve this answer











$endgroup$












  • $begingroup$
    thanks - a vastly better approach!
    $endgroup$
    – martin
    12 hours ago










Your Answer





StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
);
);
, "mathjax-editing");

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
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f193480%2fanimating-wave-motion-in-water%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









21












$begingroup$

DynamicModule[t = 0, d = 5, a = .08, base, distortion, pts, r, f, n = 10,

r[y_] := .08 y^4;
f[x_] := -2 Pi Dynamic[t] + d x;
(*f does not evaluate to a number but FE will take care of that later*)

base = Array[List, n 3, 1, 0, Pi, 0, 1 ];

distortion = Array[
Function[x, y, r[y] Cos @ f @ x, Sin @ f @ x], n 3, 1, 0, Pi, 0, 1
];

pts = base + distortion;

Row[
Animator[Dynamic @ t, AnimationRate -> .8, AppearanceElements -> ],
Graphics[
LightBlue,
Polygon @ Join[ pts[[;; , -1]], Scaled[1, 0], Scaled[0, 0]],

Darker @ Blue, AbsolutePointSize @ 5, Point @ Catenate @ pts,

AbsolutePointSize @ 7, Orange, Thick,
Point @ pts[[15, -1]], Circle[base[[15, -1]], r @ base[[15, -1, 2]]],
Point @ pts[[15, 7]], Circle[base[[15, 7]], r @ base[[15, 7, 2]]]
,
PlotRange -> 0 + .1, Pi - .1, 0, 1.2,
PlotRangePadding -> 0,
PlotRangeClipping -> True, ImageSize -> 800]
]
]


enter image description here






share|improve this answer











$endgroup$












  • $begingroup$
    thanks - a vastly better approach!
    $endgroup$
    – martin
    12 hours ago















21












$begingroup$

DynamicModule[t = 0, d = 5, a = .08, base, distortion, pts, r, f, n = 10,

r[y_] := .08 y^4;
f[x_] := -2 Pi Dynamic[t] + d x;
(*f does not evaluate to a number but FE will take care of that later*)

base = Array[List, n 3, 1, 0, Pi, 0, 1 ];

distortion = Array[
Function[x, y, r[y] Cos @ f @ x, Sin @ f @ x], n 3, 1, 0, Pi, 0, 1
];

pts = base + distortion;

Row[
Animator[Dynamic @ t, AnimationRate -> .8, AppearanceElements -> ],
Graphics[
LightBlue,
Polygon @ Join[ pts[[;; , -1]], Scaled[1, 0], Scaled[0, 0]],

Darker @ Blue, AbsolutePointSize @ 5, Point @ Catenate @ pts,

AbsolutePointSize @ 7, Orange, Thick,
Point @ pts[[15, -1]], Circle[base[[15, -1]], r @ base[[15, -1, 2]]],
Point @ pts[[15, 7]], Circle[base[[15, 7]], r @ base[[15, 7, 2]]]
,
PlotRange -> 0 + .1, Pi - .1, 0, 1.2,
PlotRangePadding -> 0,
PlotRangeClipping -> True, ImageSize -> 800]
]
]


enter image description here






share|improve this answer











$endgroup$












  • $begingroup$
    thanks - a vastly better approach!
    $endgroup$
    – martin
    12 hours ago













21












21








21





$begingroup$

DynamicModule[t = 0, d = 5, a = .08, base, distortion, pts, r, f, n = 10,

r[y_] := .08 y^4;
f[x_] := -2 Pi Dynamic[t] + d x;
(*f does not evaluate to a number but FE will take care of that later*)

base = Array[List, n 3, 1, 0, Pi, 0, 1 ];

distortion = Array[
Function[x, y, r[y] Cos @ f @ x, Sin @ f @ x], n 3, 1, 0, Pi, 0, 1
];

pts = base + distortion;

Row[
Animator[Dynamic @ t, AnimationRate -> .8, AppearanceElements -> ],
Graphics[
LightBlue,
Polygon @ Join[ pts[[;; , -1]], Scaled[1, 0], Scaled[0, 0]],

Darker @ Blue, AbsolutePointSize @ 5, Point @ Catenate @ pts,

AbsolutePointSize @ 7, Orange, Thick,
Point @ pts[[15, -1]], Circle[base[[15, -1]], r @ base[[15, -1, 2]]],
Point @ pts[[15, 7]], Circle[base[[15, 7]], r @ base[[15, 7, 2]]]
,
PlotRange -> 0 + .1, Pi - .1, 0, 1.2,
PlotRangePadding -> 0,
PlotRangeClipping -> True, ImageSize -> 800]
]
]


enter image description here






share|improve this answer











$endgroup$



DynamicModule[t = 0, d = 5, a = .08, base, distortion, pts, r, f, n = 10,

r[y_] := .08 y^4;
f[x_] := -2 Pi Dynamic[t] + d x;
(*f does not evaluate to a number but FE will take care of that later*)

base = Array[List, n 3, 1, 0, Pi, 0, 1 ];

distortion = Array[
Function[x, y, r[y] Cos @ f @ x, Sin @ f @ x], n 3, 1, 0, Pi, 0, 1
];

pts = base + distortion;

Row[
Animator[Dynamic @ t, AnimationRate -> .8, AppearanceElements -> ],
Graphics[
LightBlue,
Polygon @ Join[ pts[[;; , -1]], Scaled[1, 0], Scaled[0, 0]],

Darker @ Blue, AbsolutePointSize @ 5, Point @ Catenate @ pts,

AbsolutePointSize @ 7, Orange, Thick,
Point @ pts[[15, -1]], Circle[base[[15, -1]], r @ base[[15, -1, 2]]],
Point @ pts[[15, 7]], Circle[base[[15, 7]], r @ base[[15, 7, 2]]]
,
PlotRange -> 0 + .1, Pi - .1, 0, 1.2,
PlotRangePadding -> 0,
PlotRangeClipping -> True, ImageSize -> 800]
]
]


enter image description here







share|improve this answer














share|improve this answer



share|improve this answer








edited 4 hours ago

























answered 12 hours ago









KubaKuba

106k12208530




106k12208530











  • $begingroup$
    thanks - a vastly better approach!
    $endgroup$
    – martin
    12 hours ago
















  • $begingroup$
    thanks - a vastly better approach!
    $endgroup$
    – martin
    12 hours ago















$begingroup$
thanks - a vastly better approach!
$endgroup$
– martin
12 hours ago




$begingroup$
thanks - a vastly better approach!
$endgroup$
– martin
12 hours ago

















draft saved

draft discarded
















































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.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f193480%2fanimating-wave-motion-in-water%23new-answer', 'question_page');

);

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







Popular posts from this blog

getting Checkpoint VPN SSL Network Extender working in the command lineHow to connect to CheckPoint VPN on Ubuntu 18.04LTS?Will the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayVPN SSL Network Extender in FirefoxLinux Checkpoint SNX tool configuration issuesCheck Point - Connect under Linux - snx + OTPSNX VPN Ububuntu 18.XXUsing Checkpoint VPN SSL Network Extender CLI with certificateVPN with network manager (nm-applet) is not workingWill the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayImport VPN config files to NetworkManager from command lineTrouble connecting to VPN using network-manager, while command line worksStart a VPN connection with PPTP protocol on command linestarting a docker service daemon breaks the vpn networkCan't connect to vpn with Network-managerVPN SSL Network Extender in FirefoxUsing Checkpoint VPN SSL Network Extender CLI with certificate

Cannot Extend partition with GParted The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election ResultsCan't increase partition size with GParted?GParted doesn't recognize the unallocated space after my current partitionWhat is the best way to add unallocated space located before to Ubuntu 12.04 partition with GParted live?I can't figure out how to extend my Arch home partition into free spaceGparted Linux Mint 18.1 issueTrying to extend but swap partition is showing as Unknown in Gparted, shows proper from fdiskRearrange partitions in gparted to extend a partitionUnable to extend partition even though unallocated space is next to it using GPartedAllocate free space to root partitiongparted: how to merge unallocated space with a partition

Marilyn Monroe Ny fiainany manokana | Jereo koa | Meny fitetezanafanitarana azy.