Testing Waters

Search…

Projects

Patterns

Geometry

Lists

Sine Curve

Sine Curve from equations

Diminishing amplitude Sine Curve

1

n = 500;

2

w = 10;

3

h = 4;

4

x = 0..Math.PI*2*10..#n;

5

y = Math.Sin(0..360*w..#n) * (h..0.1..#n);

6

p = Point.ByCoordinates(x,y);

7

c = NurbsCurve.ByPoints(p);

Copied!

Diminishing amplitude Sine Curve along Base Curve

1

//Base Curve

2

c1 = NurbsCurve.ByPoints

3

(Point.ByCoordinates([0,10,50],[0,10,0]));

4

//Number of Divisions

5

n = 500;

6

//Scale Wave Extent

7

w = 10;

8

//Scale Wave Height

9

h = 5;

10

//Points on Curve

11

p1 = c1.PointAtParameter(0..1..#n);

12

//Normal at Points

13

n1 = c1.NormalAtParameter(0..1..#n);

14

//Scale wrt Base Curve Length

15

s = c1.Length/(Math.PiTimes2*w);

16

y = Math.Sin(0..360*w..#n) * (h..0.1..#n) * s;

17

p2 = p1.Translate(n1,y);

18

//Nurbs Curve

19

c2 = NurbsCurve.ByPoints(p2);

Copied!

Diminishing amplitude Sine Curve along Base Curve with Attractor

1

//Number of Points

2

ct = 200;

3

4

//Amplitude Scale

5

as = 2;

6

7

//Period Scale

8

ps = 8;

9

10

//Base Curve

11

bc = NurbsCurve.ByControlPoints(Point.ByCoordinates([0,10,40,50],[0,20,20,0]));

12

cp = bc.PointAtParameter(0..1..#ct);

13

cn = bc.NormalAtParameter(0..1..#ct);

14

15

//Sine Curve

16

ds = Math.Sin(0..360*ps..#ct)*2;

17

ic = Math.RemapRange(at.DistanceTo(cp),as,0);

18

nc = NurbsCurve.ByPoints(cp.Translate(cn,ds*Math.Pow(ic,2)));

Copied!

Last modified 11mo ago

Copy link