1 /** 2 This module defines the scalar type used for the vector geometry. 3 4 Copyright: Chris Jones 5 License: Boost Software License, Version 1.0 6 Authors: Chris Jones 7 */ 8 9 module dg2d.scalar; 10 11 /** 12 Scalar, the basic scalar type is single precision float. 13 */ 14 15 alias Scalar = double; 16 17 /* 18 Returns true if T is a implicitly convertable to Scalar 19 TODO: should this support long, short, byte etc?? 20 */ 21 22 enum bool canConvertToScalar(T) = (is(T == float) || is(T == double) || is(T == int)); 23 24 // TODO - Add a rotation struct, sin & cos pair that used to rotate ?? 25 26 // Coefficents for making cirlces from bezier curves 27 // Ie, quater unit circle is 1,0 --> 1,CBezOutset, --> CBezOutset,1 --> 0,1 28 29 enum Scalar CBezOutset = 0.551915324; // outset from bezier end point 30 enum Scalar CBezInset = 0.448084676; // inset from bounding box (1-outset) 31