-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Collapse vertices improvements for computational complexity, see phet…
- Loading branch information
1 parent
bfee494
commit e06974c
Showing
7 changed files
with
296 additions
and
166 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright 2022, University of Colorado Boulder | ||
|
||
/** | ||
* A SegmentTree for Edges. See SegmentTree for more details | ||
* | ||
* @author Jonathan Olson <[email protected]> | ||
*/ | ||
|
||
import kite from '../kite.js'; | ||
import Edge from './Edge.js'; | ||
import SegmentTree from './SegmentTree.js'; | ||
|
||
class EdgeSegmentTree extends SegmentTree<Edge> { | ||
getMinX( edge: Edge, epsilon: number ): number { | ||
// @ts-ignore -- TODO: Get Segment typed correctly | ||
return edge.segment!.bounds.left - epsilon; | ||
} | ||
|
||
getMaxX( edge: Edge, epsilon: number ): number { | ||
// @ts-ignore -- TODO: Get Segment typed correctly | ||
return edge.segment!.bounds.right + epsilon; | ||
} | ||
} | ||
|
||
kite.register( 'EdgeSegmentTree', EdgeSegmentTree ); | ||
|
||
export default EdgeSegmentTree; |
This file contains 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
Oops, something went wrong.