Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 97adaaf

Browse files
committed
Merge branch 'main' into feature/vitest-test-suite
2 parents 4208ae8 + c9ae43c commit 97adaaf

File tree

6 files changed

+54
-3
lines changed

6 files changed

+54
-3
lines changed

‎CONTRIBUTING.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ Here’s an example for JavaScript:
117117
title: Format Date
118118
description: Formats a date in 'YYYY-MM-DD' format.
119119
author: dostonnabotov
120-
tags: javascript,date,format
120+
tags: date,format
121121
---
122122

123123
```js

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Here's an example for JavaScript:
6363
title: Format Date
6464
description: Formats a date in 'YYYY-MM-DD' format.
6565
author: dostonnabotov
66-
tags: javascript,date,format
66+
tags: date,format
6767
---
6868

6969
```js
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
title: Linear Mapping
3+
description: remaps a value from one range to another
4+
author: JasimAlrawie
5+
tags: math,number-theory,algebra
6+
---
7+
8+
```c
9+
float linearMapping(float value, float minIn, float maxIn, float minOut, float maxOut) {
10+
return (value - minIn) * (maxOut - minOut)/(maxIn - minIn) + minOut;
11+
}
12+
13+
14+
// Usage:
15+
linearMapping(value, 0, 1, 0, 255); // remaps the value from (0,1) to (0,255)
16+
linearMapping(value, 0, PI*2, 0, 360); // remaps the value from rad to deg
17+
linearMapping(value, -1, 1, 1, 8); // remaps the value from (-1,1) to (1,8)
18+
```
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
title: Linear Mapping
3+
description: remaps a value from one range to another
4+
author: JasimAlrawie
5+
tags: math,number-theory,algebra
6+
---
7+
8+
```js
9+
function linearMapping(value, minIn, maxIn, minOut, maxOut) {
10+
return (value - minIn) * (maxOut - minOut)/(maxIn - minIn) + minOut
11+
}
12+
13+
// Usage:
14+
linearMapping(value, 0, 1, 0, 255) // remaps the value from (0,1) to (0,255)
15+
linearMapping(value, 0, PI*2, 0, 360) // remaps the value from rad to deg
16+
linearMapping(value, -1, 1, 1, 8) // remaps the value from (-1,1) to (1,8)
17+
```

‎snippets/python/math-and-numbers/calculate-compound-interest.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Calculate Compound Interest
33
description: Calculates compound interest for a given principal amount, rate, and time period.
44
author: axorax
5-
tags: python,math,compound interest,finance
5+
tags: math,compound interest,finance
66
---
77

88
```py
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
title: Linear Mapping
3+
description: remaps a value from one range to another
4+
author: JasimAlrawie
5+
tags: math,number-theory,algebra
6+
---
7+
8+
```py
9+
def linear_mapping(value, min_in, max_in, min_out, max_out):
10+
return (value - min_in) * (max_out - min_out) / (max_in - min_in) + min_out
11+
12+
#Usage:
13+
linear_mapping(value, 0, 1, 0, 255) # remaps the value from (0,1) to (0,255)
14+
linear_mapping(value, 0, PI*2, 0, 360) # remaps the value from rad to deg
15+
linear_mapping(value, -1, 1, 1, 8) # remaps the value from (-1,1) to (1,8)
16+
```

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /