This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main exposing (..) | |
import Point2d exposing (Point2d) | |
import Svg exposing (Svg) | |
import Svg.Attributes exposing (fill, strokeWidth, stroke, width, height, viewBox, cx, cy, r, strokeOpacity) | |
import Html exposing (text) | |
import Geometry.Svg | |
import Polygon2d | |
import Html.Attributes exposing (style, defaultValue) | |
import BoundingBox2d |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module RTree exposing (..) | |
import BoundingBox2d exposing (BoundingBox2d) | |
import Point2d exposing (Point2d) | |
import List.Extra as List | |
-- bounding boxes can go to infintiy | |
-- minNode <= maxNode // 2 | |
-- the root node has at least 2 children, unless it is a leaf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module RTree exposing (..) | |
import BoundingBox2d exposing (BoundingBox2d) | |
import Point2d exposing (Point2d) | |
import List.Extra as List | |
-- bounding boxes can go to infintiy | |
-- minNode <= maxNode // 2 | |
-- the root node has at least 2 children, unless it is a leaf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module FixedRadius exposing (Buckets, Point, fromList, search, searchReflexive, map) | |
{-| A module for fixed-radious near neighbours | |
@docs Point, Buckets, fromList, search, searchReflexive, map | |
-} | |
import Dict exposing (Dict) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE ScopedTypeVariables #-} | |
module Smallest where | |
type List a = [ a] | |
merge :: Ord a => List a -> List a -> List a | |
merge as bs = | |
case (as, bs) of | |
([], _) -> bs | |
(_, []) -> as |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Geometry.Split exposing (..) | |
type alias Config a = | |
{ length : a -> Float | |
, split : Float -> a -> ( a, a ) | |
, percentageError : Float | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extentWith : (a -> a -> Order) -> List a -> Maybe ( a, a ) | |
extentWith toOrder list = | |
let | |
max a b = | |
case toOrder a b of | |
GT -> | |
a | |
_ -> | |
b |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module SubPath exposing (..) | |
import Path exposing (DrawTo(..), MoveTo(..), lineTo, closePath, moveTo) | |
import Deque exposing (Deque) | |
import Vector2 as Vec2 exposing (Vec2) | |
import List.Extra as List | |
type SubPath | |
= SubPath { moveto : MoveTo, drawtos : Deque DrawTo } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Svg.PathParser exposing (..) | |
{-| Module for parsing SVG path syntax, using [elm-tools/parser](http://package.elm-lang.org/packages/elm-tools/parser/latest) | |
The data structure and parser is modeled according to [this W3C grammar](https://www.w3.org/TR/SVG/paths.html#PathDataBNF) | |
### data | |
The building blocks are |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Control.Monad.ST | |
import Data.Array.IArray as Array | |
import Data.STRef | |
import Data.Array.ST as Array.ST | |
import Data.Array.MArray as MArray | |
import Data.Array.Unboxed | |
solve :: Int -> List Int -> Word32 | |
solve _ [] = 0 |