Skip to content

Calculate intersection point of isoline and the grid (used for Marching squares algorithm)

License

Notifications You must be signed in to change notification settings

mluex/marching-squares-intersec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

marching-squares-intersec

Introduction

Calculate intersection point of an isoline and an edge in a grid.

Isoline (red) intersection at (0.625, 1.5)

Isoline (red) intersection at (0.625, 1.5)

Usage

var intersec = marchingSquaresIntersec({
    iso: 0,
    pointA: {
        x: 0.5,
        y: 1.5,
        f: -0.6875
    },
    pointB: {
        x: 1.5,
        y: 1.5,
        f: 4.8125
    },
});

console.log(intersec);
// { x: 0.625, y: 1.5 }

About

Calculate intersection point of isoline and the grid (used for Marching squares algorithm)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published