Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dominicschweizer:main' into main
- Loading branch information
Showing
8 changed files
with
895 additions
and
0 deletions.
There are no files selected for viewing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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,31 @@ | ||
<!DOCTYPE html> | ||
<head> | ||
<link | ||
rel="stylesheet" | ||
href="https://unpkg.com/leaflet@1.9.3/dist/leaflet.css" | ||
integrity="sha256-kLaT2GOSpHechhsozzB+flnD+zUyjE2LlfWPgU04xyI=" | ||
crossorigin="" | ||
/> | ||
<!-- Make sure you put this AFTER Leaflet's CSS --> | ||
<script | ||
src="https://unpkg.com/leaflet@1.9.3/dist/leaflet.js" | ||
integrity="sha256-WBkoXOwTeyKclOHuWtc+i2uENFpDZ9YPdf5Hf+D7ewM=" | ||
crossorigin="" | ||
></script> | ||
<script src="https://unpkg.com/@turf/turf@6/turf.min.js"></script> | ||
<script | ||
src="https://cdnjs.cloudflare.com/ajax/libs/PapaParse/5.4.1/papaparse.min.js" | ||
integrity="sha512-dfX5uYVXzyU8+KHqj8bjo7UkOdg18PaOtpa48djpNbZHwExddghZ+ZmzWT06R5v6NSk3ZUfsH6FNEDepLx9hPQ==" | ||
crossorigin="anonymous" | ||
referrerpolicy="no-referrer" | ||
></script> | ||
<script src="lib/vector2js.js"></script> | ||
<script defer type="module" src="main.js"></script> | ||
<link rel="stylesheet" href="styles.css" /> | ||
<body> | ||
<h1>Prototype Schutz und Rettung: Daten retten Leben</h1> | ||
<div id="container"> | ||
<div id="map"></div> | ||
</div> | ||
</body> | ||
</head> |
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,26 @@ | ||
/** | ||
* | ||
* @param {[number, number]} origin | ||
* @param {[number, number]} windVector | ||
* @param {number} time | ||
*/ | ||
export function createWindPolygon(origin, windVector, time) { | ||
const vOrigin = new Vector(...origin); | ||
const vWind = new Vector(...windVector).sub(vOrigin); | ||
const rotWind = vWind.rotateDegrees(90); | ||
// WindShift | ||
const windShift = rotWind.clone().rotateDegrees(180).mulScalarSelf(0.5); | ||
// FIRST BASEPOINT | ||
const basePoint1 = vOrigin.clone().addSelf(windShift); | ||
// SECOND BASEPOINT | ||
const basePoint2 = vOrigin.clone().addSelf(windShift).addSelf(rotWind); | ||
const targetPoint1 = basePoint1.add(vWind.mulScalar(time)); | ||
const targetPoint2 = basePoint2.add(vWind.mulScalar(time)); | ||
const polygon = [ | ||
basePoint2.toArray(), | ||
basePoint1.toArray(), | ||
targetPoint1.toArray(), | ||
targetPoint2.toArray(), | ||
]; | ||
return polygon; | ||
} |
Oops, something went wrong.