Point-vector arithmetic operators

Help Contents geomland Point-vector arithmetic operators
rotationc Default label offset and object colors


	+  addition (translating)
	-  substraction (translatinn)
	*  multiplication (scaling)
	/  division (scaling)
	¦  turning (rotating)
Definitions:

to :p1 'geomland.+' :p2
	if number? :p1 and number?:p2
	[output :p1 'logo.+' :p2]
	[output point :p1.x+:p2.x :p1.y+:p2.y]
end

to :p1 'geomland.-' :p2
	if not local? "p1
	[ 
		if number? :p2
		[output ('logo.-' :p2)]
		[output point (-:p2.x) (-:p2.y)]
	]
	if number? :p1 and number? :p2
	[output :p1 'logo.-' :p2]
	[output point :p1.x-:p2.x :p1.y-:p2.y]
end

to :p1 'geomland.*' :p2
	if number? :p1 and number?:p2
	[output :p1 'logo.*' :p2]
	[ 
		if number? :p1
		[output point :p1*:p2.x :p1*:p2.y]
		[output point :p2*:p1.x :p2*:p1.y]
	]
end

to :p1 'geomland./' :p2
	if number? :p1 and number?:p2
	[output :p1 'logo./' :p2]
	[
		 if number? :p1
		[output point :p2.x/:p1 :p2.y/:p1]
		[output point :p1.x/:p2 :p1.y/:p2]
	]
end

to :p1 geomland.¦ :angle
	make local "c cos :angle
	make local "s sin :angle
	output point :p1.x*:c-:p1.y*:s :p1.x*:s+:p1.y*:c
end

make "'geomland.¦.onpriority'    47
make "'geomland.*.onpriority'    45
make "'geomland./.onpriority'    45
make "'geomland.+.onpriority'    40
make "'geomland.-.onpriority'    40

rotationc Default label offset and object colors