Find the intersection of a line with a plane: Difference between revisions
Find the intersection of a line with a plane (view source)
Revision as of 02:26, 3 March 2020
, 4 years agoAdd Factor
Alextretyak (talk | contribs) m (→{{header|11l}}) |
(Add Factor) |
||
Line 295:
{{out}}
<pre>The ray intersects the plane at (0.00, -5.00, 5.00)</pre>
=={{header|Factor}}==
{{trans|11l}}
<lang factor>USING: io locals math.vectors prettyprint ;
:: intersection-point ( rdir rpt pnorm ppt -- loc )
rpt rdir pnorm rpt ppt v- v. v*n rdir pnorm v. v/n v- ;
"The ray intersects the plane at " write
{ 0 -1 -1 } { 0 0 10 } { 0 0 1 } { 0 0 5 } intersection-point .</lang>
{{out}}
<pre>
The ray intersects the plane at { 0 -5 5 }
</pre>
=={{header|FreeBASIC}}==
|