Tan Curve
Ascending Tan Curve
Last updated
Ascending Tan Curve
Last updated
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));
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));