#!/usr/bin/python -Wall # ================================================================ # John Kerl # 2007-07-02 # kerl.john.r@gmail.com # ================================================================ # This software is released under the terms of the GNU GPL. # Please see LICENSE.txt in the same directory as this file. # ================================================================ from __future__ import division # 1/2 = 0.5, not 0. import random import sys from math import * N = 128 freq = 3 # from 0 to N, mod N shift = 0.05 # from 0.0 to 1.0 s = 0.1 if (len(sys.argv) == 5): N = int(sys.argv[1]) freq = float(sys.argv[2]) shift = float(sys.argv[3]) s = float(sys.argv[4]) recip_N = 1.0/N for x in range(0, N): arg= 2*pi*freq*(x*recip_N-shift) y = cos(arg) + random.gauss(0, s) z = sin(arg) + random.gauss(0, s) print x, y, z