function measureInsertionsRing(obj) % The insertions ring is the intersection of the plane fitted to the % insertions' landmarks with the humeral head fitted sphere. insertionsArray = struct2array(obj.landmarks.insertions.ring)'; insertionsPlane = Plane(); insertionsPlane.fit(insertionsArray); ringNormal = Vector(insertionsPlane.normal); humerusCenterToPlanePoint = Vector(obj.center, insertionsPlane.point); % The ring's center is the projection of any point of the insertions' plane % on the vector starting at the humeral head center and with the same % direction as the insertion's plane normal direction. ringCenter = obj.center... + (ringNormal.dot(humerusCenterToPlanePoint) * ringNormal.vector); humerusCenterToRingCenter = Vector(obj.center, ringCenter); ringRadius = sqrt(obj.radius^2 - humerusCenterToRingCenter.norm()^2); obj.insertionsRing.center = ringCenter; obj.insertionsRing.radius = ringRadius; obj.insertionsRing.normal = ringNormal; end