The present invention relates to a method for determining the mechanical axis of a bone using an electronic device which is rigidly attached to the bone and comprises a video camera, wherein:the mechanical axis is determined from the positions of two points which define the mechanical axis;the first of the two points is determined as the centre of rotation when the bone is pivoted about the first point, the centre of rotation being determined from an output signal of the camera which captures a stationary marker device; andthe second point is the exit point of the mechanical axis on the outer surface at the opposite end of the bone to the first point.