#lang racket
(provide xpart xxpart ypart yypart xypart yxpart
dir (rename-out (angle op-angle)) decimal
(rename-out (reverse op-reverse))
unitvector length
lrcorner llcorner urcorner ulcorner
(rename-out (abs op-abs))
(rename-out (sqrt op-sqrt))
sind cosd)
(require "mpost-variable.rkt")
(require "mpost-utils.rkt")
(require "mpost-type-funs.rkt")
(define-syntax-rule (def-primary-op name type)
(def-exp (name obj)
type (to-string (list 'name obj))))
(def-primary-op xpart ((type-> 'pair 'numeric)
(type-> 'transform 'numeric)))
(def-primary-op xxpart ((type-> 'transform 'numeric)))
(def-primary-op ypart ((type-> 'pair 'numeric)
(type-> 'transform 'numeric)))
(def-primary-op yypart ((type-> 'transform 'numeric)))
(def-primary-op xypart ((type-> 'transform 'numeric)))
(def-primary-op yxpart ((type-> 'transform 'numeric)))
(def-primary-op dir ((type-> 'numeric 'pair)))
(def-primary-op angle ((type-> 'pair 'numeric)))
(def-primary-op decimal ((type-> 'numeric 'string)))
(def-primary-op unitvector ((type-> 'pair 'pair)))
(def-primary-op length ((type-> 'path 'numeric)))
(def-primary-op lrcorner ((type-> 'picture 'pair)))
(def-primary-op llcorner ((type-> 'picture 'pair)))
(def-primary-op urcorner ((type-> 'picture 'pair)))
(def-primary-op ulcorner ((type-> 'picture 'pair)))
(def-primary-op abs ((type-> 'numeric 'pair)
(type-> 'pair 'numeric)))
(def-primary-op sqrt ((type-> 'numeric 'numeric)))
(def-primary-op sind ((type-> 'numeric 'numeric)))
(def-primary-op cosd ((type-> 'numeric 'numeric)))
(def-primary-op reverse ((type-> 'path 'path)))