# Sine Curve

![Diminishing amplitude Sine Curve](/files/-MOvEMn3U5MBfufO2Ci0)

```d
n = 500;
w = 10;
h = 4;
x = 0..Math.PI*2*10..#n;
y = Math.Sin(0..360*w..#n) * (h..0.1..#n);
p = Point.ByCoordinates(x,y);
c = NurbsCurve.ByPoints(p);
```

![Diminishing amplitude Sine Curve along Base Curve](/files/-MOvFiZWYEYCq9wmwFy3)

```d
//Base Curve
c1 = NurbsCurve.ByPoints
(Point.ByCoordinates([0,10,50],[0,10,0]));
//Number of Divisions
n = 500;
//Scale Wave Extent
w = 10;
//Scale Wave Height
h = 5;
//Points on Curve
p1 = c1.PointAtParameter(0..1..#n);
//Normal at Points
n1 = c1.NormalAtParameter(0..1..#n);
//Scale wrt Base Curve Length
s = c1.Length/(Math.PiTimes2*w);
y = Math.Sin(0..360*w..#n) * (h..0.1..#n) * s;
p2 = p1.Translate(n1,y);
//Nurbs Curve
c2 = NurbsCurve.ByPoints(p2);
```

![Diminishing amplitude Sine Curve along Base Curve with Attractor](/files/-MOvDxI0xh9ek5fwkJj2)

```d
//Number of Points
ct = 200;

//Amplitude Scale
as = 2;

//Period Scale
ps = 8;

//Base Curve
bc = NurbsCurve.ByControlPoints(Point.ByCoordinates([0,10,40,50],[0,20,20,0]));
cp = bc.PointAtParameter(0..1..#ct);
cn = bc.NormalAtParameter(0..1..#ct);

//Sine Curve
ds = Math.Sin(0..360*ps..#ct)*2;
ic = Math.RemapRange(at.DistanceTo(cp),as,0);
nc = NurbsCurve.ByPoints(cp.Translate(cn,ds*Math.Pow(ic,2)));
```

![](/files/-MOvE1TrZBkykjoNyW4l)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://gitbook.testingwaters.in/geometry-1/sine-curve.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
