> For the complete documentation index, see [llms.txt](https://gitbook.testingwaters.in/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.testingwaters.in/motion/tan-curve-rising.md).

# Tan Curve

Ascending Tan Curve

![Tan Curve Graph](https://1430428134-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ld8QK19sjP1I9rhLouo%2F-MSWAXoDfiYgt8FvT6TK%2F-MSWD4zfpeIzBRPtTBf9%2FtanCurve.gif?alt=media\&token=8194b634-a967-4ece-9db2-b27022129e31)

```d
a = Dictionary.ValueAtKey(DateTime.Components(d), "second")*(1000/60);

x1 = 0..Math.PiTimes2..#1000;
y1 = Math.Tan(0..360..#1000);
p1 = Point.ByCoordinates(List.TakeItems(x1,a),List.TakeItems(y1,a));

//Visualization
p2 = Point.ByCoordinates(-1,List.LastItem(p1).Y);
a1 = Circle.ByCenterPointRadius(Point.ByCoordinates(-2),1);
l1 = Line.ByStartPointEndPoint(Point.ByCoordinates(-2),p2);
l2 = Line.ByStartPointEndPoint(List.LastItem(p1),p2);
l3 = Line.ByStartPointEndPoint(p2,Point.ByCoordinates(p2.X));
l4 = Line.ByStartPointEndPoint(List.LastItem(p1),Point.ByCoordinates(List.LastItem(p1).X));
c1 = GeometryColor.ByGeometryColor(p1,Color.ByARGB(255,255,0,0));
c2 = GeometryColor.ByGeometryColor([l1,l2],Color.ByARGB(255,0,0,255));
c3 = GeometryColor.ByGeometryColor([l3,l4],Color.ByARGB(255,255,165,0));
```

![](https://1430428134-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ld8QK19sjP1I9rhLouo%2F-MSWERojupGR-YH-fxpo%2F-MSWEakH6hLTVJAtyLn9%2FtanCurve_2021-02-02_11-06-35.png?alt=media\&token=3f6fe6f7-89c6-4486-a549-975e2fd7545f)

{% file src="/files/-MSWCzsB\_DlstTMJRLNr" %}
Dynamo Version 2.11
{% endfile %}

![Rising Tan](https://1430428134-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ld8QK19sjP1I9rhLouo%2F-MSW8-65cPkSSNOLnfXd%2F-MSW8NAPP8IWqb96uKrh%2FrisingTan.gif?alt=media\&token=97c7659e-a6d2-475f-b1b5-03b7f83e058a)

```d
a = Dictionary.ValueAtKey(DateTime.Components(d), "second")-1;

x = Math.Tan(280..440..#60);
y = (0..Math.PiTimes2..#60)/5;
yy1 = List.Flatten(List.Transpose([List.OfRepeatedItem(0,60-(1..60)),List.TakeItems(y,(1..60))])<1>,-1);
pt1 = Point.ByCoordinates(x,yy1<1>);
nc1 = NurbsCurve.ByPoints(pt1,1);
nc2 = List.LastItem(nc1).Translate(Vector.YAxis(),List.LastItem(yy1));
nc3 = List.GetItemAtIndex(nc2,a).Translate(Vector.YAxis(),(0..#4..1.3));
nc4 = List.GetItemAtIndex([nc1,nc2]<1>,a);

//Visualization
ln1 = Line.ByStartPointEndPoint(nc1[0].StartPoint,nc1[0].EndPoint);
ln2 = Line.ByStartPointDirectionLength(Point.ByCoordinates(0,-2.5),Vector.YAxis(),9);
pt2 = List.GetItemAtIndex(List.Reverse(pt1<1>),a);
pt3 = List.GetItemAtIndex(pt2,List.IndexOf(Math.Round(pt2.Y,3),0.0));
ln3 = Line.ByStartPointEndPoint(Point.ByCoordinates(0,-1),Point.ByCoordinates(pt3.X)).ExtendStart(1);
ci1 = Circle.ByCenterPointRadius(Point.ByCoordinates(0,-1),1);
ci2 = Circle.ByCenterPointRadius([ln3.StartPoint,ln3.EndPoint],0.1).Patch();
ln4 = ln3.ExtendStart(10);

//Color
cl1 = GeometryColor.ByGeometryColor(ci1,Color.ByARGB(255,0,0,255));
cl2 = GeometryColor.ByGeometryColor(ci2,Color.ByARGB(255,255,0,0));
cl3 = GeometryColor.ByGeometryColor(ln4,Color.ByARGB(255,0,255,0));
cl4 = GeometryColor.ByGeometryColor([ln1,ln2],Color.ByARGB(255,0,255,255));
```

![](https://1430428134-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ld8QK19sjP1I9rhLouo%2F-MSW8-65cPkSSNOLnfXd%2F-MSW8YUKysWAyzeCI05T%2FrisingTan_2021-02-02_10-23-47.png?alt=media\&token=52f90ea7-54fb-4290-927d-1b2f9f4d0196)

{% file src="/files/-MSW9APekPqs\_z-ou1Lt" %}
Dynamo Version 2.11
{% endfile %}
