Skip to content

harmonic

3 motifs. Import them from geomotif.motifs, or build one by name with registry.create("harmonic").

harmonic

harmonic

Sums of sines on each axis: Lissajous with more terms.

from geomotif import save_svg
from geomotif.motifs import Harmonic

motif = Harmonic()
save_svg(motif.build(), "harmonic.svg", width=320, height=320)
geomotif render harmonic --out harmonic.svg
{
  "geomotif": "1.3.1",
  "motif": "harmonic",
  "params": {
    "resolution": null,
    "x_terms": [
      [
        100.0,
        1.0,
        0.0
      ],
      [
        40.0,
        5.0,
        0.0
      ]
    ],
    "y_terms": [
      [
        100.0,
        1.0,
        1.5707963267948966
      ],
      [
        40.0,
        5.0,
        1.5707963267948966
      ]
    ],
    "center": [
      0.0,
      0.0
    ]
  }
}
Parameters
Name Type Default Notes
x_terms tuple[tuple[float, float, float], ...] ((100.0, 1.0, 0.0), (40.0, 5.0, 0.0))
y_terms tuple[tuple[float, float, float], ...] ((100.0, 1.0, 1.5707963267948966), (40.0, 5.0, 1.5707963267948966))
center Point (0.0, 0.0)
resolution int | None None Segments per strand -- a strand gets one more point than that, so both ends are included. None (default) scales density with the winding.

harmonograph

harmonograph

The Victorian drawing machine: swinging pendulums, slowly running down.

from geomotif import save_svg
from geomotif.motifs import Harmonograph

motif = Harmonograph()
save_svg(motif.build(), "harmonograph.svg", width=320, height=320)
geomotif render harmonograph --out harmonograph.svg
{
  "geomotif": "1.3.1",
  "motif": "harmonograph",
  "params": {
    "resolution": null,
    "x_pendulums": [
      {
        "$type": "geomotif.motifs.polar.Pendulum",
        "amplitude": 140.0,
        "frequency": 2.0,
        "phase": 0.0,
        "damping": 0.006
      },
      {
        "$type": "geomotif.motifs.polar.Pendulum",
        "amplitude": 60.0,
        "frequency": 3.0,
        "phase": 0.7853981633974483,
        "damping": 0.0018
      }
    ],
    "y_pendulums": [
      {
        "$type": "geomotif.motifs.polar.Pendulum",
        "amplitude": 140.0,
        "frequency": 2.005,
        "phase": 1.5707963267948966,
        "damping": 0.006
      },
      {
        "$type": "geomotif.motifs.polar.Pendulum",
        "amplitude": 60.0,
        "frequency": 4.0,
        "phase": 0.0,
        "damping": 0.0018
      }
    ],
    "duration": 50.0,
    "center": [
      0.0,
      0.0
    ]
  }
}
Parameters
Name Type Default Notes
x_pendulums tuple[Pendulum, ...] a tuple
y_pendulums tuple[Pendulum, ...] a tuple
duration float 50.0
center Point (0.0, 0.0)
resolution int | None None Segments per strand -- a strand gets one more point than that, so both ends are included. None (default) scales density with the winding.

lissajous

lissajous

Two perpendicular oscillations, plotted against each other.

from geomotif import save_svg
from geomotif.motifs import Lissajous

motif = Lissajous()
save_svg(motif.build(), "lissajous.svg", width=320, height=320)
geomotif render lissajous --out lissajous.svg
{
  "geomotif": "1.3.1",
  "motif": "lissajous",
  "params": {
    "resolution": null,
    "a": 3,
    "b": 2,
    "delta": 1.5707963267948966,
    "width": 200.0,
    "height": 200.0,
    "center": [
      0.0,
      0.0
    ]
  }
}
Parameters
Name Type Default Notes
a int 3
b int 2
delta float 1.5707963267948966
width float 200.0
height float 200.0
center Point (0.0, 0.0)
resolution int | None None Segments per strand -- a strand gets one more point than that, so both ends are included. None (default) scales density with the winding.