Solar Analysis

cp=Point.Origin();
rd=3;
a1=Line.ByStartPointDirectionLength(Point.ByCoordinates(rd,0,0),Vector.ZAxis(),rd);
a2=Arc.ByCenterPointStartPointEndPoint(cp,Point.ByCoordinates(0,0,rd),Point.ByCoordinates(rd,0,0));
asrf=Surface.ByRevolve(a2,cp,Vector.ZAxis(),0,360);
//Solar Study
solarstudy=SolarAnalysis.Analyze(Weather.ByLatitudeLongitude
(12.9716,77.5946),asrf,[],
TimeStudy.FromStartTimeToEndTime(DSCore.DateTime.
FromString("April 30, 2016 9:00 AM"),DSCore.DateTime.
FromString("April 29, 2017 6:00 PM"),false),0.125,0);
cumulative=List.Flatten(solarstudy["Cumulative"],1);
average=List.Flatten(solarstudy["Average"],1);
peak=List.Flatten(solarstudy["Peak"],1);
calculationpoints=List.Flatten(solarstudy["Calculation Points"],1);
cumPt=List.SortByKey(Flatten(calculationpoints),Flatten(cumulative))["sorted list"];
avgPt=List.SortByKey(Flatten(calculationpoints),Flatten(average))["sorted list"];
pekPt=List.SortByKey(Flatten(calculationpoints),Flatten(peak))["sorted list"];
//Colors
Color.ByARGB(255,[0,0,255],[0,255,0],[255,0,0]);
0..2;
0..1..#List.Count(cumPt);
//Angles
cumPhi=(Vector.XAxis()).AngleWithVector(((List.LastItem(cumPt)).Project(Plane.XZ(),Vector.YAxis())).AsVector());
cumThe=(Vector.XAxis()).AngleWithVector(((List.LastItem(cumPt)).Project(Plane.XY(),Vector.ByCoordinates(0,0,-1))).AsVector());
avgPhi=(Vector.XAxis()).AngleWithVector(((List.LastItem(avgPt)).Project(Plane.XZ(),Vector.YAxis())).AsVector());
avgThe=(Vector.XAxis()).AngleWithVector(((List.LastItem(avgPt)).Project(Plane.XY(),Vector.ByCoordinates(0,0,-1))).AsVector());
pekPhi=(Vector.XAxis()).AngleWithVector(((List.LastItem(pekPt)).Project(Plane.XZ(),Vector.YAxis())).AsVector());
pekThe=(Vector.XAxis()).AngleWithVector(((List.LastItem(pekPt)).Project(Plane.XY(),Vector.ByCoordinates(0,0,-1))).AsVector());