File:Hyperboloid ruled surface animation (short).gif
From Wikimedia Commons, the free media repository
Jump to navigation
Jump to search
Hyperboloid_ruled_surface_animation_(short).gif (370 × 470 pixels, file size: 2.03 MB, MIME type: image/gif, looped, 61 frames, 6.1 s)
File information
Structured data
Captions
Summary
[edit]This diagram was created with Mathematica.
DescriptionHyperboloid ruled surface animation (short).gif |
English: An illustration of the the generation of a hyperboloid of revolution as the surface of revolution of a slanted line.
This is a fork of File:Hyperboloid ruled surface animation v2.gif, with the extra "stages" removed. |
Date | |
Source | Own work |
Author | Lemondoge |
Other versions |
|
Source code InfoField | Mathematica code(* config *)
frames = 60; (*frame count for first generation loop *)
offset = -Pi + 0.8; (* ensure favorable "alignment" *)
(* From the Mathematica stack exchange:
https://mathematica.stackexchange.com/questions/10957/an-efficient-circular-arc-primitive-for-graphics3d;
function by user Sjoerd C.de Vries; CC BY-SA *)
splineCircle[m_List, r_, angles_List : {0, 2 \[Pi]}] :=
Module[{seg, \[Phi], start, end, pts, w, k}, {start, end} =
Mod[angles // N, 2 \[Pi]];
If[end <= start, end += 2 \[Pi]];
seg = Quotient[end - start // N, \[Pi]/2];
\[Phi] = Mod[end - start // N, \[Pi]/2];
If[seg == 4, seg = 3; \[Phi] = \[Pi]/2];
pts =
r RotationMatrix[start] . # & /@
Join[Take[{{1, 0}, {1, 1}, {0, 1}, {-1, 1}, {-1,
0}, {-1, -1}, {0, -1}}, 2 seg + 1],
RotationMatrix[seg \[Pi]/2] . # & /@ {{1,
Tan[\[Phi]/2]}, {Cos[\[Phi]], Sin[\[Phi]]}}];
If[Length[m] == 2, pts = m + # & /@ pts,
pts = m + # & /@
Transpose[
Append[Transpose[pts], ConstantArray[0, Length[pts]]]]];
w = Join[
Take[{1, 1/Sqrt[2], 1, 1/Sqrt[2], 1, 1/Sqrt[2], 1},
2 seg + 1], {Cos[\[Phi]/2], 1}];
k = Join[{0, 0, 0}, Riffle[#, #] &@Range[seg + 1], {seg + 1}];
BSplineCurve[pts, SplineDegree -> 2, SplineKnots -> k,
SplineWeights -> w]] /; Length[m] == 2 || Length[m] == 3
k[a_, b_, t_] := a + (b - a)*t^3
f[u_, v_,
skew_ : 2 Pi/3] := {Cos[u + offset], Sin[u + offset],
1} (v) + {Cos[u + skew + offset],
Sin[u + skew + offset], -1} (1 - v)
borderWidth = -BorderDimensions[
ParametricPlot3D[f[u, v, 2 Pi/3], {u, 0, 2 Pi}, {v, 0, 1},
PlotRange -> {{-1, 1}, {-1, 1}, {-1, 1}}, Axes -> False,
Boxed -> False, ViewPoint -> {1.3, -3, 2}]] + 2;
(*generate table*)
hyperbList =
Table[ImagePad[Module[{p = 3 (j/frames)^2 - 2 (j/frames)^3},
Show[
ParametricPlot3D[f[u, v], {u, 0, p*2 Pi}, {v, 0, 1},
ColorFunction ->
Function[{x, y, z, u},
RGBColor[k[0.880722, 0, u*p], 0.611041, k[0.142051, 1, u*p],
1 - (u*p)^3]], Boxed -> False, Axes -> False,
ViewPoint -> {1.3, -3, 2},
PlotRange -> {{-1, 1}, {-1, 1}, {-1, 1}},
PlotPoints -> Ceiling[125 j/frames + 2],
MeshFunctions -> {#5 &}],
Graphics3D[{
(* custom-bake the v mesh, and add other thingamabobbers *)
GrayLevel[0.2],
Table[
Line[{f[2 Pi/16*i, 0], f[2 Pi/16*i, 1]}], {i, 1,
Floor[p*16]}],
Thick, Blue,
splineCircle[{0, 0 , 1}, 1],
splineCircle[{0, 0, -1}, 1],
Black,
Line[{f[0, 0], f[0, 1]}],
Line[{f[p*2 Pi, 0], f[p * 2 Pi, 1]}],
PointSize[0.03],
Point[{f[0, 0], f[0, 1]}],
Point[{f[p*2 Pi, 0], f[p * 2 Pi, 1]}],
GrayLevel[0.2],
Line[{f[p*2 Pi, 1], {0, 0,
1}, {Cos[p*2 Pi + offset + 2 Pi/3],
Sin[p*2 Pi + offset + 2 Pi/3], 1}, f[p*2 Pi, 0]}],
splineCircle[{0, 0, 1},
1/4, {p*2 Pi + offset, p*2 Pi + offset + 2 Pi/3}],
Line[{{0, 1, -1}, {0, -1, -1}}],
Line[{{1, 0, -1}, {-1, 0, -1}}],
Line[{{0, 0, 1}, {0, 0, -1}}]
}]
]
], borderWidth], {j, 1, frames}];
(* add frame of u = 0 manually *)
PrependTo[hyperbList, ImagePad[Graphics3D[
{Thick, Blue,
splineCircle[{0, 0 , 1}, 1],
splineCircle[{0, 0, -1}, 1],
Black,
Line[{f[0, 0], f[0, 1]}],
PointSize[0.03],
Point[{f[0, 0], f[0, 1]}],
GrayLevel[0.2],
Line[{f[0, 1], {0, 0, 1}, {Cos[offset + 2 Pi/3],
Sin[offset + 2 Pi/3], 1}, f[0, 0]}],
splineCircle[{0, 0, 1}, 1/4, {offset, offset + 2 Pi/3}],
Line[{{0, 1, -1}, {0, -1, -1}}],
Line[{{1, 0, -1}, {-1, 0, -1}}],
Line[{{0, 0, 1}, {0, 0, -1}}]
},
Boxed -> False, Axes -> False,
PlotRange -> {{-1, 1}, {-1, 1}, {-1, 1}},
ViewPoint -> {1.3, -3, 2}],
borderWidth]];
(* Export, with first and last frames lengthened *)
Export["hyperboloidAnimShort.gif", hyperbList,
"DisplayDurations" -> {1, Splice@ConstantArray[1/15, frames - 1], 1}]
|
Licensing
[edit]I, the copyright holder of this work, hereby publish it under the following license:
This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication. | |
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.
http://creativecommons.org/publicdomain/zero/1.0/deed.enCC0Creative Commons Zero, Public Domain Dedicationfalsefalse |
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 18:57, 21 September 2024 | 370 × 470 (2.03 MB) | Lemondoge (talk | contribs) | Uploaded own work with UploadWizard |
You cannot overwrite this file.
File usage on Commons
There are no pages that use this file.