function d = p24_fd ( p ) %*****************************************************************************80 % %% P24_FD is a signed distance function for problem 24. % % Discussion: % % The region is the outline of a hand.. % % The V array must repeat the first point as the last! % % Licensing: % % This code is distributed under the GNU LGPL license. % % Modified: % % 18 January 2018 % % Parameters: % % Input, real P, one or more points. % % Output, real D, the signed distance of each point to the boundary of the region. % v = [ ... 0.496200, 0.208600; ... 0.557100, 0.319900; ... 0.606100, 0.415800; ... 0.644900, 0.500900; ... 0.627100, 0.534400; ... 0.593200, 0.512700; ... 0.568900, 0.469200; ... 0.539800, 0.424000; ... 0.500500, 0.433900; ... 0.486000, 0.501800; ... 0.481700, 0.569700; ... 0.493500, 0.663800; ... 0.495700, 0.733500; ... 0.496800, 0.783300; ... 0.489800, 0.840300; ... 0.477900, 0.855700; ... 0.461800, 0.850200; ... 0.457500, 0.822200; ... 0.456900, 0.770600; ... 0.456400, 0.736200; ... 0.448300, 0.678300; ... 0.437500, 0.612200; ... 0.418100, 0.595000; ... 0.405200, 0.642100; ... 0.396100, 0.714500; ... 0.381500, 0.773300; ... 0.369100, 0.862000; ... 0.351400, 0.885500; ... 0.329800, 0.866500; ... 0.334700, 0.817600; ... 0.348700, 0.744300; ... 0.354600, 0.688200; ... 0.372400, 0.586000; ... 0.360500, 0.586000; ... 0.339000, 0.641200; ... 0.314200, 0.701800; ... 0.279800, 0.811300; ... 0.272200, 0.815800; ... 0.256100, 0.808600; ... 0.249600, 0.786900; ... 0.256100, 0.754300; ... 0.287300, 0.656600; ... 0.297000, 0.622200; ... 0.322800, 0.537100; ... 0.312600, 0.530800; ... 0.288400, 0.557900; ... 0.251800, 0.626700; ... 0.231300, 0.657500; ... 0.215100, 0.656600; ... 0.213000, 0.621300; ... 0.235100, 0.572400; ... 0.250700, 0.535300; ... 0.289400, 0.461100; ... 0.299100, 0.420400; ... 0.306100, 0.363300; ... 0.313100, 0.319000; ... 0.323900, 0.264700; ... 0.336300, 0.235700; ... 0.356200, 0.217600 ]; d = dpoly ( p, v ); return end