Model.hm_triplecos#
- Model.hm_triplecos(start, end)#
Get the cosine angle of two vectors.
- Parameters:
- Returns:
hwReturnStatus- Status objectHmQueryResult- Result object containing the output values:cosine (double) - Cosine angle between
startandendvectors
Example#
Calculate the cosine angle between vector with coordinates [ 0.5 , 0.6 , 0.0 ] and vector with coordinates [ 1.0 , 1.0 , 0.0 ]#import hm import hm.entities as ent model = hm.Model() _, result = model.hm_triplecos(start=[0.5, 0.6, 0.0], end=[1.0, 1.0, 0.0]) print("cosine", result.cosine)