algebra_3D.Point.op

Point.op()

Operator redefinition for the class Point.

Parameters

Type

Description

B

Point

The second member as a Point

op

string

the operator to execute

Returns
Point

The computed point operation

Examples

>>> a=Point(1,1,1)
>>> b=a.copy()
>>> print(a)
 ( 1.0 , 1.0 , 1.0 )
printed
>>> print(b)
 ( 1.0 , 1.0 , 1.0 )
printed
>>> print(a.op(b,'+'))
 ( 2.0 , 2.0 , 2.0 )
printed
>>> print(a.op(b,'-'))
 ( 0.0 , 0.0 , 0.0 )
printed