Hi,
I have 2 lines which are in the same layer, what I want to do is calculate the angle between the 2 lines. How could I do this in c#? I have the 2 Line objects within my code.
Is there a command or method I could use to get the angle between the 2 lines?

Below is an image of the 2 lines which I want to get the angle of.

if both lines have share the same origin and are pointing away from this origin you could get their direction vectors (their tangents) and use them to calculate the angle using Rhino.Geometry.Vector3d.VectorAngle

First, the angle the method returns is in radians, so youâ€™ll need to convert it to degrees.
Second, if you do not provide a proper plane, it can be that youâ€™ll get the reflex angle, which you have to subtract from 180 degrees. This seems to be the case here, 2.059 in radians equals 117.97201 degrees, once you subtract it from 180 youâ€™ll get 62.0279 degrees.

Youâ€™ll might also try to use the method which allows to define a plane. Using a plane normal as a third vector technically allows to get a signed angle. The math behind should be something like below function, which is python btw:

def GetSignedAngle(Va, Vb, Vn):
'''gets signed angle between Va and Vb, Vn is the plane normal'''
# all vectors must be unitized
cross = Rhino.Geometry.Vector3d.CrossProduct(Va, Vb)
# angle in radians
return math.atan2(cross * Vn, Va * Vb)