 		x: _.max point.map (size) -> size.x
 		y: _.max point.map (size) -> size.y
 
+Utils.pointDistance = (pointA, pointB) ->
+	distance =
+		x: Math.abs(pointB.x - pointA.x)
+		y: Math.abs(pointB.y - pointA.y)
+
+Utils.pointInvert = (point) ->
+	point =
+		x: 0 - point.x
+		y: 0 - point.y
+
+Utils.pointTotal = (point) ->
+	point.x + point.y
+
+Utils.pointAbs = (point) ->
+	point =
+		x: Math.abs point.x
+		y: Math.abs point.y
+
+Utils.pointInFrame = (point, frame) ->
+	return false  if point.x < frame.minX or point.x > frame.maxX
+	return false  if point.y < frame.minY or point.y > frame.maxY
+	true
+
 # Size
 
 Utils.sizeMin = ->

Utils.devicePixelRatio = ->
	window.devicePixelRatio

######################################################
# MATH FUNCTIONS
		


	frame

# Coordinate system

Utils.convertPoint = (input, layerA, layerB) ->

	# Convert a point between two layer coordinate systems

	point = {}

	for k in ["x", "y", "width", "height"]
		point[k] = input[k]

	superLayersA = layerA?.superLayers() or []
	superLayersB = layerB?.superLayers() or []
	
	superLayersB.push layerB if layerB
	
	for layer in superLayersA
		point.x += layer.x - layer.scrollFrame.x
		point.y += layer.y - layer.scrollFrame.y

	for layer in superLayersB
		point.x -= layer.x + layer.scrollFrame.x
		point.y -= layer.y + layer.scrollFrame.y
	
	return point

_.extend exports, Utils

