File: transform.ml

package info (click to toggle)
mlpost 0.8.2-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,976 kB
  • sloc: ml: 19,575; javascript: 4,047; makefile: 608; ansic: 34; lisp: 19; sh: 15
file content (37 lines) | stat: -rw-r--r-- 1,628 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
(**************************************************************************)
(*                                                                        *)
(*  Copyright (C) Johannes Kanig, Stephane Lescuyer                       *)
(*  Jean-Christophe Filliatre, Romain Bardou and Francois Bobot           *)
(*                                                                        *)
(*  This software is free software; you can redistribute it and/or        *)
(*  modify it under the terms of the GNU Library General Public           *)
(*  License version 2.1, with the special exception on linking            *)
(*  described in file LICENSE.                                            *)
(*                                                                        *)
(*  This software is distributed in the hope that it will be useful,      *)
(*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *)
(*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                  *)
(*                                                                        *)
(**************************************************************************)

open Types

type t' = matrix
type matrix = t'

type t = t' list

let scaled = Matrix.scale
let rotated f = Matrix.rotation (Num.deg2rad f)
let shifted = Matrix.translation
let slanted = Matrix.slanted
let xscaled = Matrix.xscaled
let yscaled = Matrix.yscaled
let zscaled = Matrix.zscaled
let reflect = Matrix.reflect
let rotate_around p f = Matrix.rotate_around p (Num.deg2rad f)

let explicit t = t

(* applied the transformations in the order of the list *)
let id = []