Similarity is quantity that reflects the strength of relationship between two objects or two features. This quantity is usually having range of either -1 to +1 or normalized into 0 to 1.
Than you need to calculate the distance of two features by one of the methods below:
- Simple Matching distance
- Jaccard's distance
- Hamming distance
- Jaccard's coefficient
- simple matching coefficient
For line... you can represent it by angle (a) and length (l) properties or L1= P1(x1,y1), P2(x2,y2) below is the similarity with a and l.
now measure the angle for angles and lengths
- A_user =20 and Length_User =50
- A_teacher30 and Length_Teacher =55
- Now, normalize the values.
Using euclidean distance
similarity = SquareRoot((A_user - A_teacher30 )^2 +(Length_User - Length_Teacher )^2)
gives the similarity measure. You can also use above mentioned methods based on the problem and the features.