Group Abstract Group Abstract

Message Boards Message Boards

[GIF] BCC (Minimal figure-eight knot on the body-centered cubic lattice)

4 Replies
Posted 7 years ago

With a little tweaking:

bcc41 = Standardize[Import["https://www.math.ubc.ca/~andrewr/knots/data/BCC41.dat"],
                    Mean, 1 &];

DynamicModule[{b, n, pl, θ, cols = RGBColor /@ {"#eeeeee", "#222831"}},
              Manipulate[θ = (Pi - ArcTan[Sqrt[23 + 16 Sqrt[2]]])
                                       (#^3/(1 - 3 # (1 - #))) &[Mod[t, 1]];
                         {n, b} = Which[t < 1 || t == 2,
                                        {{-1, 0, 0}, Normalize[{0, 1, 1}]}.
                                        RotationMatrix[θ, {-1, -1 - Sqrt[2], 1}],
                                        1 <= t < 2,
                                        {{0, 0, 1}, {1, 0, 0}}.
                                        RotationMatrix[θ, {1, -1 - Sqrt[2], 1}]];
                         pl = bcc41.Transpose[{Cross[b, n], b}];
                         Graphics[{EdgeForm[Directive[Thickness[.01],
                                                      JoinForm["Round"], cols[[1]]]], 
                                   FaceForm[], Polygon[pl],
                                   FaceForm[cols[[1]]], Disk[#, .1] & /@ pl},
                                  ImageSize -> 540, PlotRange -> 3, 
                                  Background -> cols[[-1]]], {t, 0, 2}]]
POSTED BY: J. M.

Oh, nice! I never knew about Standardize[]. Very useful!

I also really like your $t \mapsto \frac{t^3}{1-3t(1-t)}$ function for smooth interpolation.

Posted 7 years ago

I've found myself using Standardize[] a lot for "centering" operations; glad you think it's neat, too.

As for that rational function: I came up with "rational smoothstep" some time back, but this may be the first time I exhibited it in code I have shown publicly. That being said, I'm sure I'm not the first one to come up with using a rational Hermite interpolant for tasks like these.

POSTED BY: J. M.

enter image description here - Congratulations! This post is now a Staff Pick as distinguished by a badge on your profile! Thank you, keep it coming, and consider contributing your work to the The Notebook Archive!

POSTED BY: EDITORIAL BOARD
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard