4.04c Scalar product: calculate and use for angles

297 questions

Sort by: Default | Easiest first | Hardest first
Edexcel CP AS 2018 June Q4
11 marks Standard +0.3
Part of the mains water system for a housing estate consists of water pipes buried beneath the ground surface. The water pipes are modelled as straight line segments. One water pipe, \(W\), is buried beneath a particular road. With respect to a fixed origin \(O\), the road surface is modelled as a plane with equation \(3 x - 5 y - 18 z = 7\), and \(W\) passes through the points \(A ( - 1 , - 1 , - 3 )\) and \(B ( 1,2 , - 3 )\). The units are in metres.
  1. Use the model to calculate the acute angle between \(W\) and the road surface. A point \(C ( - 1 , - 2,0 )\) lies on the road. A section of water pipe needs to be connected to \(W\) from \(C\).
  2. Using the model, find, to the nearest cm, the shortest length of pipe needed to connect \(C\) to \(W\).
    V349 SIHI NI IMIMM ION OCVJYV SIHIL NI LIIIM ION OOVJYV SIHIL NI JIIYM ION OC
Edexcel CP AS 2020 June Q4
13 marks Standard +0.3
  1. All units in this question are in metres.
A lawn is modelled as a plane that contains the points \(L ( - 2 , - 3 , - 1 ) , M ( 6 , - 2,0 )\) and \(N ( 2,0,0 )\), relative to a fixed origin \(O\).
  1. Determine a vector equation of the plane that models the lawn, giving your answer in the form \(\mathbf { r } = \mathbf { a } + \lambda \mathbf { b } + \mu \mathbf { c }\)
    1. Show that, according to the model, the lawn is perpendicular to the vector \(\left( \begin{array} { c } 1 \\ 2 \\ - 10 \end{array} \right)\)
    2. Hence determine a Cartesian equation of the plane that models the lawn. There are two posts set in the lawn.
      There is a washing line between the two posts.
      The washing line is modelled as a straight line through points at the top of each post with coordinates \(P ( - 10,8,2 )\) and \(Q ( 6,4,3 )\).
  2. Determine a vector equation of the line that models the washing line.
  3. State a limitation of one of the models. The point \(R ( 2,5,2.75 )\) lies on the washing line.
  4. Determine, according to the model, the shortest distance from the point \(R\) to the lawn, giving your answer to the nearest cm. Given that the shortest distance from the point \(R\) to the lawn is actually 1.5 m ,
  5. use your answer to part (e) to evaluate the model, explaining your reasoning.
Edexcel CP AS 2023 June Q6
11 marks Standard +0.3
  1. The line \(l _ { 1 }\) has equation \(\mathbf { r } = \left( \begin{array} { r } - 2 \\ 2 \\ 0 \end{array} \right) + \lambda \left( \begin{array} { l } 3 \\ 0 \\ 1 \end{array} \right)\) where \(\lambda\) is a scalar parameter.
The line \(l _ { 2 }\) is parallel to \(\left( \begin{array} { r } 1 \\ 2 \\ - 3 \end{array} \right)\)
  1. Show that \(l _ { 1 }\) and \(l _ { 2 }\) are perpendicular. The plane \(\Pi\) contains the line \(l _ { 1 }\) and is perpendicular to \(\left( \begin{array} { r } 1 \\ 2 \\ - 3 \end{array} \right)\)
  2. Determine a Cartesian equation of \(\Pi\)
  3. Verify that the point \(A ( 3,1,1 )\) lies on \(\Pi\) Given that
    • the point of intersection of \(\Pi\) and \(l _ { 2 }\) has coordinates \(( 2,3,2 )\)
    • the point \(B ( p , q , r )\) lies on \(l _ { 2 }\)
    • the distance \(A B\) is \(2 \sqrt { 5 }\)
    • \(p , q\) and \(r\) are positive integers
    • determine the coordinates of \(B\).
Edexcel CP AS 2024 June Q6
12 marks Moderate -0.3
  1. The drainage system for a sports field consists of underground pipes.
This situation is modelled with respect to a fixed origin \(O\).
According to the model,
  • the surface of the sports field is a plane with equation \(z = 0\)
  • the pipes are straight lines
  • one of the pipes, \(P _ { 1 }\), passes through the points \(A ( 3,4 , - 2 )\) and \(B ( - 2 , - 8 , - 3 )\)
  • a different pipe, \(P _ { 2 }\), has equation \(\frac { x - 1 } { 2 } = \frac { y - 3 } { 4 } = \frac { z + 1 } { - 2 }\)
  • the units are metres
    1. Determine a vector equation of the line representing the pipe \(P _ { 1 }\)
    2. Determine the coordinates of the point at which the pipe \(P _ { 1 }\) meets the surface of the playing field, according to the model.
Determine, according to the model,
  • the acute angle between pipes \(P _ { 1 }\) and \(P _ { 2 }\), giving your answer in degrees to 3 significant figures,
  • the shortest distance between pipes \(P _ { 1 }\) and \(P _ { 2 }\)
  • Edexcel CP AS Specimen Q2
    10 marks Standard +0.2
    1. The plane \(\Pi\) passes through the point \(A\) and is perpendicular to the vector \(\mathbf { n }\)
    Given that $$\overrightarrow { O A } = \left( \begin{array} { r } 5 \\ - 3 \\ - 4 \end{array} \right) \quad \text { and } \quad \mathbf { n } = \left( \begin{array} { r } 3 \\ - 1 \\ 2 \end{array} \right)$$ where \(O\) is the origin,
    1. find a Cartesian equation of \(\Pi\). With respect to the fixed origin \(O\), the line \(l\) is given by the equation $$\mathbf { r } = \left( \begin{array} { r } 7 \\ 3 \\ - 2 \end{array} \right) + \lambda \left( \begin{array} { r } - 1 \\ - 5 \\ 3 \end{array} \right)$$ The line \(l\) intersects the plane \(\Pi\) at the point \(X\).
    2. Show that the acute angle between the plane \(\Pi\) and the line \(l\) is \(21.2 ^ { \circ }\) correct to one decimal place.
    3. Find the coordinates of the point \(X\).
    Edexcel FP1 AS Specimen Q4
    10 marks Standard +0.8
    4. \begin{figure}[h]
    \includegraphics[alt={},max width=\textwidth]{ff1fc9b0-6514-44e0-a2a3-46aa6411ce10-08_538_807_251_630} \captionsetup{labelformat=empty} \caption{Figure 1}
    \end{figure} Figure 1 shows a sketch of a solid sculpture made of glass and concrete. The sculpture is modelled as a parallelepiped. The sculpture is made up of a concrete solid in the shape of a tetrahedron, shown shaded in Figure 1, whose vertices are \(\mathrm { O } ( 0,0,0 ) , \mathrm { A } ( 2,0,0 ) , \mathrm { B } ( 0,3,1 )\) and \(\mathrm { C } ( 1,1,2 )\), where the units are in metres. The rest of the solid parallelepiped is made of glass which is glued to the concrete tetrahedron.
    1. Find the surface area of the glued face of the tetrahedron.
    2. Find the volume of glass contained in this parallelepiped.
    3. Give a reason why the volume of concrete predicted by this model may not be an accurate value for the volume of concrete that was used to make the sculpture. \section*{Q uestion 4 continued}
    Edexcel CP1 2019 June Q7
    7 marks Standard +0.3
    1. The line \(l _ { 1 }\) has equation
    $$\frac { x - 1 } { 2 } = \frac { y + 1 } { - 1 } = \frac { z - 4 } { 3 }$$ The line \(l _ { 2 }\) has equation $$\mathbf { r } = \mathbf { i } + 3 \mathbf { k } + t ( \mathbf { i } - \mathbf { j } + 2 \mathbf { k } )$$ where \(t\) is a scalar parameter.
    1. Show that \(l _ { 1 }\) and \(l _ { 2 }\) lie in the same plane.
    2. Write down a vector equation for the plane containing \(l _ { 1 }\) and \(l _ { 2 }\)
    3. Find, to the nearest degree, the acute angle between \(l _ { 1 }\) and \(l _ { 2 }\)
    Edexcel CP1 2024 June Q7
    10 marks Standard +0.3
    1. The line \(l _ { 1 }\) has equation
    $$\mathbf { r } = \mathbf { i } - 2 \mathbf { j } + 3 \mathbf { k } + \lambda ( 2 \mathbf { i } + \mathbf { j } - 4 \mathbf { k } )$$ and the line \(l _ { 2 }\) has equation $$\mathbf { r } = 5 \mathbf { i } + p \mathbf { j } - 7 \mathbf { k } + \mu ( 6 \mathbf { i } + \mathbf { j } + 8 \mathbf { k } )$$ where \(\lambda\) and \(\mu\) are scalar parameters and \(p\) is a constant.
    The plane \(\Pi\) contains \(l _ { 1 }\) and \(l _ { 2 }\)
    1. Show that the vector \(3 \mathbf { i } - 10 \mathbf { j } - \mathbf { k }\) is perpendicular to \(\Pi\)
    2. Hence determine a Cartesian equation of \(\Pi\)
    3. Hence determine the value of \(p\) Given that
      • the lines \(l _ { 1 }\) and \(l _ { 2 }\) intersect at the point \(A\)
      • the point \(B\) has coordinates \(( 12 , - 11,6 )\)
      • determine, to the nearest degree, the acute angle between \(A B\) and \(\Pi\)
    Edexcel FP1 2021 June Q4
    7 marks Standard +0.3
    4. \begin{figure}[h]
    \includegraphics[alt={},max width=\textwidth]{55803551-f13d-419f-8b51-31642bd20b6a-12_474_1063_264_502} \captionsetup{labelformat=empty} \caption{Figure 2}
    \end{figure} A small aircraft is landing in a field.
    In a model for the landing the aircraft travels in different straight lines before and after it lands, as shown in Figure 2. The vector \(\mathbf { v } _ { \mathbf { A } }\) is in the direction of travel of the aircraft as it approaches the field.
    The vector \(\mathbf { V } _ { \mathbf { L } }\) is in the direction of travel of the aircraft after it lands.
    With respect to a fixed origin, the field is modelled as the plane with equation $$x - 2 y + 25 z = 0$$ and $$\mathbf { v } _ { \mathbf { A } } = \left( \begin{array} { r } 3 \\ - 2 \\ - 1 \end{array} \right)$$
    1. Write down a vector \(\mathbf { n }\) that is a normal vector to the field.
    2. Show that \(\mathbf { n } \times \mathbf { v } _ { \mathbf { A } } = \lambda \left( \begin{array} { r } 13 \\ 19 \\ 1 \end{array} \right)\), where \(\lambda\) is a constant to be determined. When the aircraft lands it remains in contact with the field and travels in the direction \(\mathbf { v } _ { \mathbf { L } }\) The vector \(\mathbf { v } _ { \mathbf { L } }\) is in the same plane as both \(\mathbf { v } _ { \mathbf { A } }\) and \(\mathbf { n }\) as shown in Figure 2.
    3. Determine a vector which has the same direction as \(\mathbf { V } _ { \mathbf { L } }\)
    4. State a limitation of the model.
    Edexcel FP1 2021 June Q7
    7 marks Challenging +1.2
    1. With respect to a fixed origin \(O\), the line \(l\) has equation
    $$( \mathbf { r } - ( 12 \mathbf { i } + 16 \mathbf { j } - 8 \mathbf { k } ) ) \times ( 9 \mathbf { i } + 6 \mathbf { j } + 2 \mathbf { k } ) = \mathbf { 0 }$$ The point \(A\) lies on \(l\) such that the direction cosines of \(\overrightarrow { O A }\) with respect to the \(\mathbf { i } , \mathbf { j }\) and \(\mathbf { k }\) axes are \(\frac { 3 } { 7 } , \beta\) and \(\gamma\). Determine the coordinates of the point \(A\).
    Edexcel FP1 2022 June Q3
    9 marks Standard +0.8
    1. With respect to a fixed origin \(O\), the points \(A\) and \(B\) have coordinates \(( 2,2 , - 1 )\) and ( \(4,2 p , 1\) ) respectively, where \(p\) is a constant.
    For each of the following, determine the possible values of \(p\) for which,
    1. \(O B\) makes an angle of \(45 ^ { \circ }\) with the positive \(x\)-axis
    2. \(\overrightarrow { O A } \times \overrightarrow { O B }\) is parallel to \(\left( \begin{array} { r } 4 \\ - p \\ 2 \end{array} \right)\)
    3. the area of triangle \(O A B\) is \(3 \sqrt { 2 }\)
    Edexcel FP1 2024 June Q9
    10 marks Standard +0.8
    1. The line \(l _ { 1 }\) has equation \(\mathbf { r } = \left( \begin{array} { r } 2 \\ - 3 \\ 1 \end{array} \right) + \lambda \left( \begin{array} { r } 3 \\ 4 \\ - 1 \end{array} \right)\) The line \(l _ { 2 }\) has equation \(\mathbf { r } = \left( \begin{array} { c } 13 \\ 5 \\ 8 \end{array} \right) + \mu \left( \begin{array} { r } 1 \\ - 2 \\ 5 \end{array} \right)\) where \(\lambda\) and \(\mu\) are scalar parameters.
      The lines \(l _ { 1 }\) and \(l _ { 2 }\) intersect at the point \(P\).
      1. Determine the coordinates of \(P\). Given that the plane \(\Pi\) contains both \(l _ { 1 }\) and \(l _ { 2 }\)
      2. determine a Cartesian equation for \(\Pi\).
      3. Determine a Cartesian equation for each of the two lines that
    Edexcel AEA 2012 June Q4
    11 marks Challenging +1.8
    4. $$\mathbf { a } = \left( \begin{array} { r } - 3 \\ 1 \\ 4 \end{array} \right) , \quad \mathbf { b } = \left( \begin{array} { r } 5 \\ - 2 \\ 9 \end{array} \right) , \quad \mathbf { c } = \left( \begin{array} { r } 8 \\ - 4 \\ 3 \end{array} \right)$$ The points \(A , B\) and \(C\) with position vectors \(\mathbf { a } , \mathbf { b }\) and \(\mathbf { c }\) ,respectively,are 3 vertices of a cube.
    1. Find the volume of the cube. The points \(P , Q\) and \(R\) are vertices of a second cube with \(\overrightarrow { P Q } = \left( \begin{array} { l } 3 \\ 4 \\ \alpha \end{array} \right) , \overrightarrow { P R } = \left( \begin{array} { l } 7 \\ 1 \\ 0 \end{array} \right)\) and \(\alpha\) a positive constant.
    2. Given that angle \(Q P R = 60 ^ { \circ }\) ,find the value of \(\alpha\) .
    3. Find the length of a diagonal of the second cube.
    OCR MEI Further Pure Core AS 2024 June Q9
    8 marks Challenging +1.2
    9 In this question you must show detailed reasoning. Find a vector \(\mathbf { v }\) which has the following properties.
    • It is a unit vector.
    • It is parallel to the plane \(2 x + 2 y + z = 10\).
    • It makes an angle of \(45 ^ { \circ }\) with the normal to the plane \(\mathrm { x } + \mathrm { z } = 5\).
    \section*{END OF QUESTION PAPER} }{www.ocr.org.uk}) after the live examination series.
    If OCR has unwittingly failed to correctly acknowledge or clear any third-party content in this assessment material, OCR will be happy to correct its mistake at the earliest possible opportunity.
    For queries or further information please contact The OCR Copyright Team, The Triangle Building, Shaftesbury Road, Cambridge CB2 8EA.
    OCR is part of Cambridge University Press \& Assessment, which is itself a department of the University of Cambridge.
    OCR Further Pure Core 1 2018 September Q5
    8 marks Standard +0.3
    5 Two planes, \(\Pi _ { 1 }\) and \(\Pi _ { 2 }\), have equations \(3 x + 2 y + z = 4\) and \(2 x + y + z = 3\) respectively.
    1. Find the acute angle between \(\Pi _ { 1 }\) and \(\Pi _ { 2 }\). The line \(L\) has equation \(x = 1 - y = 2 - z\).
    2. Show that \(L\) lies in both planes.
    Edexcel FP3 Q2
    7 marks Standard +0.3
    2. \begin{figure}[h]
    \includegraphics[alt={},max width=\textwidth]{045545c7-06d9-40b6-9d01-fc792ab0aa07-01_222_241_525_2042} \captionsetup{labelformat=empty} \caption{Figure 1}
    \end{figure} The points \(A , B\) and \(C\) have position vectors \(\mathbf { a } , \mathbf { b }\) and \(\mathbf { c }\) respectively, relative to a fixed origin \(O\), as shown in Figure 1. It is given that $$\mathbf { a } = \mathbf { i } + \mathbf { j } , \quad \mathbf { b } = \mathbf { 3 i } - \mathbf { j } + \mathbf { k } \quad \text { and } \quad \mathbf { c } = \mathbf { 2 i } + \mathbf { j } - \mathbf { k } .$$ Calculate
    1. \(\mathbf { b } \times \mathbf { c }\),
    2. \(\mathbf { a . } ( \mathbf { b } \times \mathbf { c } )\),
    3. the area of triangle \(O B C\),
    4. the volume of the tetrahedron \(O A B C\).
    AQA C4 2006 January Q7
    10 marks Moderate -0.3
    7 The quadrilateral \(A B C D\) has vertices \(A ( 2,1,3 ) , B ( 6,5,3 ) , C ( 6,1 , - 1 )\) and \(D ( 2 , - 3 , - 1 )\).
    The line \(l _ { 1 }\) has vector equation \(\mathbf { r } = \left[ \begin{array} { r } 6 \\ 1 \\ - 1 \end{array} \right] + \lambda \left[ \begin{array} { l } 1 \\ 1 \\ 0 \end{array} \right]\).
      1. Find the vector \(\overrightarrow { A B }\).
      2. Show that the line \(A B\) is parallel to \(l _ { 1 }\).
      3. Verify that \(D\) lies on \(l _ { 1 }\).
    1. The line \(l _ { 2 }\) passes through \(D ( 2 , - 3 , - 1 )\) and \(M ( 4,1,1 )\).
      1. Find the vector equation of \(l _ { 2 }\).
      2. Find the angle between \(l _ { 2 }\) and \(A C\).
    AQA C4 2007 January Q6
    13 marks Moderate -0.3
    6 The points \(A , B\) and \(C\) have coordinates \(( 3 , - 2,4 ) , ( 5,4,0 )\) and \(( 11,6 , - 4 )\) respectively.
      1. Find the vector \(\overrightarrow { B A }\).
      2. Show that the size of angle \(A B C\) is \(\cos ^ { - 1 } \left( - \frac { 5 } { 7 } \right)\).
    1. The line \(l\) has equation \(\mathbf { r } = \left[ \begin{array} { r } 8 \\ - 3 \\ 2 \end{array} \right] + \lambda \left[ \begin{array} { r } 1 \\ 3 \\ - 2 \end{array} \right]\).
      1. Verify that \(C\) lies on \(l\).
      2. Show that \(A B\) is parallel to \(l\).
    2. The quadrilateral \(A B C D\) is a parallelogram. Find the coordinates of \(D\).
    AQA C4 2008 January Q9
    11 marks Standard +0.3
    9 The points \(A\) and \(B\) lie on the line \(l _ { 1 }\) and have coordinates \(( 2,5,1 )\) and \(( 4,1 , - 2 )\) respectively.
      1. Find the vector \(\overrightarrow { A B }\).
      2. Find a vector equation of the line \(l _ { 1 }\), with parameter \(\lambda\).
    1. The line \(l _ { 2 }\) has equation \(\mathbf { r } = \left[ \begin{array} { r } 1 \\ - 3 \\ - 1 \end{array} \right] + \mu \left[ \begin{array} { r } 1 \\ 0 \\ - 2 \end{array} \right]\).
      1. Show that the point \(P ( - 2 , - 3,5 )\) lies on \(l _ { 2 }\).
      2. The point \(Q\) lies on \(l _ { 1 }\) and is such that \(P Q\) is perpendicular to \(l _ { 2 }\). Find the coordinates of \(Q\).
    AQA C4 2009 January Q8
    12 marks Standard +0.3
    8 The points \(A\) and \(B\) have coordinates \(( 2,1 , - 1 )\) and \(( 3,1 , - 2 )\) respectively. The angle \(O B A\) is \(\theta\), where \(O\) is the origin.
      1. Find the vector \(\overrightarrow { A B }\).
      2. Show that \(\cos \theta = \frac { 5 } { 2 \sqrt { 7 } }\).
    1. The point \(C\) is such that \(\overrightarrow { O C } = 2 \overrightarrow { O B }\). The line \(l\) is parallel to \(\overrightarrow { A B }\) and passes through the point \(C\). Find a vector equation of \(l\).
    2. The point \(D\) lies on \(l\) such that angle \(O D C = 90 ^ { \circ }\). Find the coordinates of \(D\).
    AQA C4 2010 January Q8
    11 marks Standard +0.3
    8 The points \(A , B\) and \(C\) have coordinates \(( 2 , - 1 , - 5 ) , ( 0,5 , - 9 )\) and \(( 9,2,3 )\) respectively. The line \(l\) has equation \(\mathbf { r } = \left[ \begin{array} { r } 2 \\ - 1 \\ - 5 \end{array} \right] + \lambda \left[ \begin{array} { r } 1 \\ - 3 \\ 2 \end{array} \right]\).
    1. Verify that the point \(B\) lies on the line \(l\).
    2. Find the vector \(\overrightarrow { B C }\).
    3. The point \(D\) is such that \(\overrightarrow { A D } = 2 \overrightarrow { B C }\).
      1. Show that \(D\) has coordinates \(( 20 , - 7,19 )\).
      2. The point \(P\) lies on \(l\) where \(\lambda = p\). The line \(P D\) is perpendicular to \(l\). Find the value of \(p\).
    AQA C4 2005 June Q7
    12 marks Standard +0.3
    7 The points \(A\) and \(B\) have coordinates \(( 1,4,2 )\) and \(( 2 , - 1,3 )\) respectively.
    The line \(l\) has equation \(\mathbf { r } = \left[ \begin{array} { r } 2 \\ - 1 \\ 3 \end{array} \right] + \lambda \left[ \begin{array} { r } 1 \\ - 1 \\ 1 \end{array} \right]\).
    1. Show that the distance between the points \(A\) and \(B\) is \(3 \sqrt { 3 }\).
    2. The line \(A B\) makes an acute angle \(\theta\) with \(l\). Show that \(\cos \theta = \frac { 7 } { 9 }\).
    3. The point \(P\) on the line \(l\) is where \(\lambda = p\).
      1. Show that $$\overrightarrow { A P } \cdot \left[ \begin{array} { r } 1 \\ - 1 \\ 1 \end{array} \right] = 7 + 3 p$$
      2. Hence find the coordinates of the foot of the perpendicular from the point \(A\) to the line \(l\).
    AQA C4 2007 June Q7
    11 marks Standard +0.3
    7 The lines \(l _ { 1 }\) and \(l _ { 2 }\) have equations \(\mathbf { r } = \left[ \begin{array} { r } 8 \\ 6 \\ - 9 \end{array} \right] + \lambda \left[ \begin{array} { r } 3 \\ - 3 \\ - 1 \end{array} \right]\) and \(\mathbf { r } = \left[ \begin{array} { r } - 4 \\ 0 \\ 11 \end{array} \right] + \mu \left[ \begin{array} { r } 1 \\ 2 \\ - 3 \end{array} \right]\) respectively.
    1. Show that \(l _ { 1 }\) and \(l _ { 2 }\) are perpendicular.
    2. Show that \(l _ { 1 }\) and \(l _ { 2 }\) intersect and find the coordinates of the point of intersection, \(P\).
    3. The point \(A ( - 4,0,11 )\) lies on \(l _ { 2 }\). The point \(B\) on \(l _ { 1 }\) is such that \(A P = B P\). Find the length of \(A B\).
    AQA C4 2008 June Q7
    12 marks Standard +0.8
    7 The coordinates of the points \(A\) and \(B\) are ( \(3 , - 2,1\) ) and ( \(5,3,0\) ) respectively. The line \(l\) has equation \(\mathbf { r } = \left[ \begin{array} { l } 5 \\ 3 \\ 0 \end{array} \right] + \lambda \left[ \begin{array} { r } 1 \\ 0 \\ - 3 \end{array} \right]\).
    1. Find the distance between \(A\) and \(B\).
    2. Find the acute angle between the lines \(A B\) and \(l\). Give your answer to the nearest degree.
    3. The points \(B\) and \(C\) lie on \(l\) such that the distance \(A C\) is equal to the distance \(A B\). Find the coordinates of \(C\).
    OCR MEI C4 2006 January Q3
    6 marks Moderate -0.3
    3 A triangle ABC has vertices \(\mathrm { A } ( - 2,4,1 ) , \mathrm { B } ( 2,3,4 )\) and \(\mathrm { C } ( 4,8,3 )\). By calculating a suitable scalar product, show that angle ABC is a right angle. Hence calculate the area of the triangle.