JSTS is licensed with a dual BSD/EPL liceence. For more details go to the project page.
NOTE: OpenLayers specific code omitted. Please refer to this page for a complete example of usage with OpenLayers 3.
var reader = new jsts.io.WKTReader() var a = reader.read('POINT (-20 0)') var b = reader.read('POINT (20 0)')
a = a.buffer(40) b = b.buffer(40)
var intersection = a.intersection(b)
var difference = a.difference(b)
var union = a.union(b)
var symDifference = a.symDifference(b)