#macro ComputeIntersectionPoint (Point1, Angle1, Point2, Angle2) #local Point1_Macro = Point1; //Local copies must be used because parameters #local Angle1_Macro = Angle1; //are passed by reference. #local Point2_Macro = Point2; #local Angle2_Macro = Angle2; #if (Point2_Macro.x < Point1_Macro.x) #local TPoint = Point2_Macro; #local TAngle = Angle2_Macro; #local Point2_Macro = Point1_Macro; #local Angle2_Macro = Angle1_Macro; #local Point1_Macro = TPoint; #local Angle1_Macro = TAngle; #end //#if #local XOffset = Point1_Macro.x; #local YOffset = Point1_Macro.y; #local Point1_Macro = <0, 0, 0>; #local Point2_Macro = Point2_Macro - ; #local Theta = degrees (atan (Point2_Macro.y / Point2_Macro.x)); #local R2 = sqrt (Point2_Macro.x * Point2_Macro.x + Point2_Macro.y * Point2_Macro.y); #local Angle1_Macro = Angle1_Macro - Theta; #local Angle2_Macro = Angle2_Macro - Theta; #local Point2_Macro = ; #local Angle2_Macro = 180 - Angle2_Macro; #local Angle3_Macro = 180 - Angle1_Macro - Angle2_Macro; #local R1 = R2 * sin (radians (Angle2_Macro)) / sin (radians (Angle3_Macro)); #local Angle1_Macro = Angle1_Macro + Theta; #local TempPoint = ; #declare IntersectionPoint = ; #end //#macro ComputeIntersectionPoint #include "colors.inc" camera { orthographic location <0, 0, -20> look_at <0, 0, 0> } //camera light_source {<20, 10, -200> color White * 1.4 shadowless} #local GridlineWidth = .05; #local Gridline = object { box {<-GridlineWidth / 2, -9 - GridlineWidth / 2, 0> } } //object #local I = 0; #while (I < 10) #if (I > 0) #local GridColor = texture {pigment {color White * .6}} object {Gridline translate I * x texture {GridColor}} object {Gridline translate -I * x texture {GridColor}} object {Gridline rotate 90 * z translate I * y texture {GridColor}} object {Gridline rotate 90 * z translate -I * y texture {GridColor}} #else #local GridColor = texture {pigment {color White * 1.2}} object {Gridline translate -.0001 * z texture {GridColor}} object {Gridline rotate 90 * z translate -.0001 * z texture {GridColor}} #end //#if #local I = I + 1; #end //#while #local Marker = object { union { sphere {<0, 0, 0>, .2} cylinder {<0, 0, 0> <6, 0, 0>, .05} cone {<0, 0, 0>, .2, <.5, 0, 0>, 0 translate 6 * x} } //union } //object #local Point1 = <4, 1, 0>; #local Angle1 = 125; #local Point2 = <5, 3, 0>; #local Angle2 = 190; object {Marker rotate Angle1 * z translate Point1 texture {pigment {color Green}}} object {Marker rotate Angle2 * z translate Point2 texture {pigment {color Yellow}}} ComputeIntersectionPoint (Point1, Angle1, Point2, Angle2) cylinder {<0, 0, -.21> <0, 0, 0>, .2 translate IntersectionPoint texture {pigment {color DarkOrchid}}} cylinder {<0, 0, -.22> <0, 0, 0>, .1 translate IntersectionPoint texture {pigment {color Red}}}