#NEWLINE# def equals( self , other ) : #NEWLINE# #INDENT# 'Returns True if self and other are the same mathematical entities' #NEWLINE# if ( not isinstance ( other , Ray ) ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# return ( ( self . source == other . source ) and ( other . p2 in self ) )