Adding function for Yassin
This commit is contained in:
@ -178,7 +178,7 @@
|
||||
<p class="text-semibold text-2xl pb-4">Known universes</p>
|
||||
<p id="existing-universes" class="text-xl"></p>
|
||||
<div id="disclaimer" class="pb-4">
|
||||
<form id="universe-creator">
|
||||
<form id="universe-creator">
|
||||
<label for="search" class="mb-2 text-sm font-medium text-gray-900 sr-only text-white">Search</label>
|
||||
<div class="relative">
|
||||
<div class="absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none">
|
||||
|
||||
10
src/API.ts
10
src/API.ts
@ -1739,6 +1739,16 @@ export class UserAPI {
|
||||
return sum / values.length;
|
||||
};
|
||||
|
||||
public range = (
|
||||
inputY: number, yMin: number,
|
||||
yMax: number, xMin: number,
|
||||
xMax: number): number => {
|
||||
const percent = (inputY - yMin) / (yMax - yMin);
|
||||
const outputX = percent * (xMax - xMin) + xMin;
|
||||
return outputX;
|
||||
};
|
||||
|
||||
|
||||
limit = (value: number, min: number, max: number): number => {
|
||||
/**
|
||||
* Limits a value between a minimum and a maximum.
|
||||
|
||||
Reference in New Issue
Block a user