Consider pyramid edges as vectors, on which is built this figure. The coordinates of the points in the vertices are A(X₁;Y₁;Z₁), B(X₂;Y₂;Z₂), C(X₃;Y₃;Z₃), D(X₄;Y₄;Z₄), determine the projection vectors coming from the top of the pyramid, on the axis orthogonal coordinate system subtract from each coordinate of end vector of the corresponding coordinate of the beginning: AB{X₂-X₁;Y₂-Y₁;Z₂-Z₁}, AC{X₃-X₁;Y₃-Y₁;Z₃ Is Z₁}, AD{X₄-X₁;Y₄-Y₁;Z₄-Z₁}.
Take advantage of the fact that the volume of the parallelepiped built on these vectors must be six times the volume of the pyramid. The volume of such a parallelepiped is easy to determine - it is equal to the mixed product of vectors: |AB*AC*AD|. So the volume of a pyramid (V) will be one-sixth of this value: V = ⅙*|AB*AC*AD|.
To calculate the mixed product from the obtained in the first step coordinates create a matrix by placing in every row of the three coordinates of the corresponding vector:

(X₂-X₁) (Y₂-Y₁) (Z₂-Z₁)
(X₃-X₁) (Y₃-Y₁) (Z₃ Is Z₁)
(X₄-X₁) (Y₄-Y₁) (Z₄-Z₁)

Then calculate its determinant - line by line multiply all the elements of the set and add the results:

(X₂-X₁)*(Y₃-Y₁)*(Z₄-Z₁) + (Y₂-Y₁)*(Z₃ Is Z₁)*(X₄-X₁) + (Z₂-Z₁)*(X₃-X₁)*(Y₄-Y₁) + (Z₂-Z₁)*(Y₃-Y₁)*(X₄-X₁) + (Y₂-Y₁)*(X₃-X₁)*(Z₄-Z₁) + (X₂-X₁)*(Z₃ Is Z₁)*(Y₄-Y₁).
Obtained in the previous step value corresponds to the volume of the parallelepiped is divided into six, in order to nd the volume of a pyramid. In General this cumbersome formula can be written as: V = ⅙*|AB*AC*AD| = ⅙*((X₂-X₁)*(Y₃-Y₁)*(Z₄-Z₁) + (Y₂-Y₁)*(Z₃ Is Z₁)*(X₄-X₁) + (Z₂-Z₁)*(X₃-X₁)*(Y₄-Y₁) + (Z₂-Z₁)*(Y₃-Y₁)*(X₄-X₁) + (Y₂-Y₁)*(X₃-X₁)*(Z₄-Z₁) + (X₂-X₁)*(Z₃ Is Z₁)*(Y₄-Y₁)).
If the calculations in the solution of the problem of lead is not required, and need only obtain a numerical result, it is easier to use for the calculation of online services. The network is not difficult to find scripts that can help you with intermediate calculations - calculate the determinant of the matrix or to calculate the volume of a pyramid is entered in the form fields to the coordinates. A couple of links to such services is given below.