Descriptions and Examples for the POV-Ray Raytracer by Friedrich A. Lohmueller
Deutsch Deutsch

Home
back to overview
- POV-Ray Tutorials

  - Analytical Geometry
    with POV-Ray
    - Index -
  - Insert Menu Add-on
    & Download
 
  - Basics
    Possibilities and Needs

    Points & Lines
    - Points in 3D
    - Line Sections, Straight,
      Vectors, Distance Markers
    - Surfaces & Planes
    - Output of Results,
      Captions
    - Points of Intersection
    - Circles
    Solids
    - Tetrahedron
    - Parallelepiped
    - Round Solids
    -
  - Overview by Table
      on "analytical_g.inc"
  - Vector Analysis
      with POV-Ray
  - Righthanded & Lefthanded
    Systems of Coordinates
    and the Cross Product

  - Samples from
    Analytical Geometry
    - Parallelogram of the
        Middles of the Edges
    - Trace Points of a Straight Line
    - Calculations
      about a Triangle

    - Area of a Parallelogram
        and Cross Product
    - Shadow of a Pyramid
    > Hit a plane || yz-plane
    - Angle of triangle & yz-plane
                                       

Analytical Geometry with POV-Ray

- Samples -

    Where a staight line
  hits a plane parallel to yz plane

We seek the point S in which a straight line declared by 2 point A and B intersects a plane parallel to yz plane containing the point C.
Here are the point A and B:
(For details on textures see the scene file!)
// given 2 points:
#declare A = <-0.00,1.00,-2.00>;
#declare B = < 0.75,1.20,-1.50>;
// and a point on a plane || to yz :
#declare C = < 2.00,0.00,0.00>;

// Showing A and B:
sphere{ <0,0,0>, 0.075 translate A
        texture{ T_YellowGreen }
      }
sphere{ <0,0,0>, 0.075 translate B
        texture{ T_Yellow }
      }
And here is a box showing the position
of the plane x = 2:
box { <0.00, 0.00,-2.00>,< 0.025, 5.00, 3.50>
      texture { pigment{ color rgb<1, 1, 1>}
                finish { phong 1 }
              } // end of texture

       translate <C.x,0,0>
    } // end of box --------------------------
Calculation of the intersection in point S:
Equations of a straigth line through A and B by the components:
  [The components of a vector: A=<A.x, A.y, A.z>]
x1 = A.x + m ( B.x - A.x ) I
x2 = A.y + m ( B.y - A.y ) II
x3 = A.z + m ( B.z - A.z ) III
Here x1 = 2. (=C.x)
So: 2 = A.x + m ( B.x - A.x ) | -A.x
<=> 2 - A.x = m ( B.x - A.x ) | : (B.x - A.x )
<=> m = ( 2 - A.x )/( B.x - A.x )
#declare  m = ( C.x - A.x )/( B.x - A.x );
#declare SX =  C.x; // here: = 2
#declare SY =  A.y +  m *( B.y - A.y );
#declare SZ =  A.z +  m *( B.z - A.z );
#declare S = < SX, SY, SZ >;
// Show S:
sphere{ <0,0,0>, 0.1 translate S
        texture{ T_Red }
      }
Where a staight line
  hits a plane parallel to the yz plane

This scene for POV-Ray: "Straight2Plane_1.pov" file
top

© Friedrich A. Lohmüller, 2011
www.f-lohmueller.de