racket/collects/plot/contracted/math.rkt
Neil Toronto 5a2aa226fb Initial commit for `typed/plot' module
I also made some minor changes to `plot' so that its functions would
type more easily. In particular, everything that used to take a list
of vectors now accepts a (Sequenceof (Sequenceof Real)). The 3D
discrete histogram renderers now also accept lists as well as vectors
in the sequence of categories.

For now, in typed/plot functions, optional non-keyword arguments are
required. As soon as Vincent closes PR 13354, I should be able to
uncomment part of a macro in "typed/plot/syntax.rkt" to make them
correctly optional.
2012-12-15 21:22:50 -07:00

33 lines
1.5 KiB
Racket

#lang racket/base
(require racket/contract unstable/latent-contract)
(require "../common/math.rkt")
(provide equal?*
;; Flonums
flblend flsum fldistance (activate-contract-out flonum-ok-for-range?)
;; Reals
maybe-inexact->exact
min* max* blend atan2 sum real-modulo distance
floor-log/base ceiling-log/base
polar->cartesian 3d-polar->3d-cartesian
;; Vectors
vcross vcross2 v+ v- vneg v* v/ vmag^2 vmag vnormalize vdot vcos-angle vrational? v= vcenter)
;; Intervals
(provide (contract-out (struct ivl ([min (or/c real? #f)] [max (or/c real? #f)]))
[ivl-meet (->* () () #:rest (listof ivl?) ivl?)]
[ivl-join (->* () () #:rest (listof ivl?) ivl?)])
empty-ivl unknown-ivl rational-ivl?
(activate-contract-out
ivl-empty? ivl-known? ivl-rational? ivl-singular? ivl-length ivl-center ivl-zero-length?
ivl-inexact->exact ivl-contains? ivl-translate bounds->intervals clamp-real))
;; Rectangles
(provide (contract-out [rect-meet (->* () () #:rest (listof (vectorof ivl?)) (vectorof ivl?))]
[rect-join (->* () () #:rest (listof (vectorof ivl?)) (vectorof ivl?))])
(activate-contract-out
empty-rect unknown-rect bounding-rect rational-rect?
rect-empty? rect-known? rect-rational? rect-area rect-center rect-zero-area? rect-singular?
rect-inexact->exact rect-translate rect-contains?))