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 triange yz-plane
                                       

Analytical Geometry with POV-Ray

- Samples -

    Angle between a triange
    and the yz-plane.

The triangle is given by 3 points:
(For details on textures see the scene file!)
#declare A = <-0.00,1.20,-1.00>;
// and 2 point s on a plane || to yz:
#declare B = < 2.00,1.50, 1.50>;
#declare C = < 2.00,0.00,-1.000>;

// Showing points A, B and C:
sphere{ <0,0,0>, 0.075 translate A
        texture{ T_YellowGreen }
      }
sphere{ <0,0,0>, 0.075 translate B
        texture{ T_Yellow }
      }
sphere{ <0,0,0>, 0.075 translate C
        texture{ T_Orange }
      }
triangle{ A,B,C
         pigment{color rgbt<1,1,0.5,0.5>}}
// and 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
    } // end of box --------------------------
Calculation of the base point P of a line
  perpendicular to the line CB:

// Angle between AC and BC at point C:
#declare Angle_C = degrees(VAngle(B-C,A-C));

// Distance from C to the base point P
//  of a line perpendicular to BC:
#declare Len_P = vlength(A-C)*cos(radians(Angle_C));

// Base point P on line CB:
#declare P = C + (B-C)*Len_P/vlength(B-C);
// Show P (red)
sphere{ <0,0,0>, 0.08 translate P
        texture{ T_Red }
      }








Base Point P of a line
  perpendicular to the line CB

Calculation of the angle between the triangle ABC
and a plane parallel to the yz-plane:

#declare PA_Vector = A-P ;
object{  Vector( <0,0,0>,PA_Vector, 0.025)
         translate P
         texture{ T_Lila }
      }
// vertical to CL on plane x=2:
#declare PB_Vector = B-P;
object{  Vector( <0,0,0>,PB_Vector, 0.025)
         translate P
         texture{ T_Cyan }
      } 
Vertical to PB in plane x=2:
  [ The components of a vector: A=<A.x,A.y,A.z>]
Note:
  A 2D-vector V1 = < x1, y1> is perpendicular
   to a vector V2 = <-y1, x1> !
By analogy:
  A 3D-vector V1 = < 0, y1, z1> is perpendicular
   to a vector V2 = < 0, -z1, y1> !

#declare Vertical_to_PB =
         <0,PB_Vector.z,-PB_Vector.y> ;
object{  Vector(<0,0,0>,Vertical_to_PB, 0.025)
         translate P
         pigment{ rgb<1,0,0.5> }
      }

// Angle between vector PA (violet) and
// vector perpenticular to PB in plane x=2
// (wine red)
#declare Angle_ABC_to_Plane =
         degrees(VAngle(Vertical_to_PB,PA_Vector));

// Angle between CB and z direction:
#declare Angle_PB_to_Z =
         degrees(atan((B.y-C.y)/(B.z-C.z)));
Angle between a triangle and
a plane parallel to the yz-plane.

This scene for POV-Ray: "AngleTriangle2Plane_1.pov" file
Needs my include file: "shapes_lo.inc" (see 'step 2')

Note: If we have a triange with only one point on the plane || to the yz plane, we need to calculate the second point on the plane like in 'Hit a plane || yz-plane'.

Animation see here!

top

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