Find the intersection of a line with a plane: Difference between revisions
Content added Content deleted
Alextretyak (talk | contribs) m (→{{header|11l}}) |
(Add Factor) |
||
Line 295: | Line 295: | ||
{{out}} |
{{out}} |
||
<pre>The ray intersects the plane at (0.00, -5.00, 5.00)</pre> |
<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}}== |
=={{header|FreeBASIC}}== |