# Visualizing a curve "from the side"

I'm trying to animate the idea that values of $$\sin x$$ are concentrated around -1 and 1. Looking at the sine curve from the side, middle should be lighter than the edges.

My first attempt doesn't communicate this properly, color is the same no matter what the thickness is. Any better ideas?

steps = 5;
v1 = {0, 0, 100};
v2 = {100, 0, 0};
blendViewpoints[v1_, v2_, t_] :=
With[{angle = t*Pi/2}, v1*Cos[angle] + v2*Sin[angle]];
R = ParametricRegion[{{s, Sin[s] + tt},
0 <= s <= 2 Pi && 0 <= tt <= .1}, {s, tt}];

genPlot[t_] := With[{vp = blendViewpoints[v1, v2, t]},
Plot3D[1, {x, y} \[Element] R, Filling -> Axis, Mesh -> False,
Axes -> None, Boxed -> False, ViewPoint -> vp,
ViewVertical -> {0, 1, 0}, SphericalRegion -> True]
];

ListAnimate[Table[genPlot[t], {t, 0, 1, 1/steps}]]


The density from the side should look more like this (notebook):

• You'd be best off exporting to blender or some other 3d software and raytracing some 3d linear fog for the extruded part. It's either that or you can figure out how to do it with CUDAVolumetricRender but I don't recommend that pain. Sep 18 '21 at 13:12
• Maybe I misunderstand you, but should your comment not say: "that values of sin x are concentrated around -1 and 1". If so, then I think this idea is better represented by the derivative of Sin[x]. Where it is small, there are a lot of random pts, where it is large, random pts are spread out. Sep 18 '21 at 18:55
• Manipulate[Graphics[{Opacity[0.1], Point[Table[{0., Sin[k]}, {k, 0., n}]], PlotRange->1], {n, 1, 10000}]? Sep 18 '21 at 21:28
• @MichaelE2 It is too thin. Also, a closing curly brace is missing Sep 18 '21 at 21:39
• @მამუკაჯიბლაძე Neither objection is unfixable. Sep 18 '21 at 22:09