1 /** This file is part of Shapes.
3 ** Shapes is free software: you can redistribute it and/or modify
4 ** it under the terms of the GNU General Public License as published by
5 ** the Free Software Foundation, either version 3 of the License, or
8 ** Shapes is distributed in the hope that it will be useful,
9 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
10 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 ** GNU General Public License for more details.
13 ** You should have received a copy of the GNU General Public License
14 ** along with Shapes. If not, see <http://www.gnu.org/licenses/>.
16 ** Copyright 2008 Henrik Tidefelt
32 [if d == to_center (0,0)
36 [if d == to_top (0,~1)
37 [if d == to_llft (1,1)
38 [if d == to_lrt (~1,1)
39 [if d == to_urt (~1,~1)
40 [if d == to_ulft (1,~1)
41 [error [sprintf [`The following direction constant was not recognized by dirtopoint: %g´ d]]]]]]]]]]]]
46 [if [abs z.x] > 2*[abs z.y]
48 [if [abs z.y] > 2*[abs z.x]
51 [if [abs z.x] > 2*[abs z.y]
53 [if [abs z.y] > 2*[abs z.x]
57 [if [abs z.x] > 2*[abs z.y]
59 [if [abs z.y] > 2*[abs z.x]
62 [if [abs z.x] > 2*[abs z.y]
64 [if [abs z.y] > 2*[abs z.x]
68 dir_to: \ d .> [dir 180° + d * 45°]
70 shiftoff: \ obj d .> [centerat obj [dirtopoint d]]
71 shiftoffwlm: \ obj d .> [centeratwlm obj [dirtopoint d]]