More and more geotechnical structures are being designed on the basis of computer simulation of the soil behaviour. This is due to the fact that precise modelling of soil behaviour and all but the simplest geometries result in equations that are impossible to solve using hand-calculation methods. The most often used numerical tool for solving the equations is the finite-element method, which is the method of choice in this thesis.The classical material model for soils is the Mohr-Coulomb material model. For many years, this model has been the basis in the calculation of the bearing capacity of foundations, mainly due to its simplicity which allows simple solutions with simple geometries. But for complex geometries a numerical solution is needed. It turns out that the apparently simple Mohr-Coulomb model is non-trivial to implement in the finite-element method. This is due to the fact that the Mohr-Coulomb yield criterion and the corresponding plastic potential possess corners and an apex, which causes numerical difficulties. A simple, elegant and efficient solution to these problems is presented in this thesis. The solution is based on a transformation into principal stress space and is valid for all linear isotropic plasticity models in which corners and apexes are encountered. The validity and merits of the proposed solution are examined in relation to the Mohr-Coulomb and the Modified Mohr-Coulomb material models. It is found that the proposed method compares well with existing methods.As with soils, rock masses also exhibit a pressure dependent constitutive behaviour. Therefore the Mohr-Coulomb and Modified Mohr-Coulomb material models are frequently used to model the behaviour of rock masses. The linear dependency of the strength on the pressure inherent in the Mohr-Coulomb model has turned out be a poor approximation for rock masses at the stress levels of practical interest. In recent years this has caused a non-linear Mohr-Coulomb criterion, the Hoek-Brown criterion, to become extensively applied for practical purposes. No evidence in literature, however, can be found on how to correctly implement this model in the finite element method. The known implementations rely on a rounding on the corners and/or simplifications which greatly increase calculation times. In this thesis the principal stress update method is extended from the use with linear yield criteria to a Hoek-Brown material. The efficiency and validity are demonstrated by comparing the finite-element results with well-known solutions for simple geometries.A common geotechnical problem is the assessment of slope stability. For slopes with simple geometries and consisting of a linear Mohr-Coulomb material, this can be carried out by hand calculations. For more complex geometries the calculations can be carried out using the finite-element method. The soil parameters used in the analyses are often based on triaxial testing. There is, however, discrepancies between the stress levels in the tests, and the stress levels present at slope failures, where the stress levels are low. This means that the safety of the slope can be overestimated when using the Mohr-Coulomb criterion with parameters obtained from standard triaxial tests. The overestimation is caused by the fact that the soil strength, when viewed in a large stress interval, is not linearly dependent on the pressure, as stated by the Mohr-Coulomb model. Therefore a non-linear Hoek-Brown material model gives more reliable predictions. The concept of the slope safety factor is inherently tied to the notion of expressing the soil strength as a so-called Mohr envelope. The calculation of the slope safety factor using a linear Mohr envelope is straightforward, but with a curved Mohr envelope this is not trivial. A method of calculating the safety factor of a slope using the finite-element method and a curved Mohr envelope is presented. The results are compared with the safety factors obtained with a linear Mohr envelope, with which they are directly comparable, when the presented method is used.The classical problem of yield surfaces with corners and apexes is elaborated upon. A small modification to the formulation of the constitutive matrices on corners and apexes is presented. This formulation greatly improves the numerical stability of plasticity calculations. This is illustrated with a bearing capacity calculation on a highly frictional soil.