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 c68d155

Browse files
fix all mistakes,typos
1 parent 8090117 commit c68d155

File tree

3 files changed

+14
-16
lines changed

3 files changed

+14
-16
lines changed
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
---
2-
title: Linear Remappibg
2+
title: Linear Mapping
33
description: remaps a value from one range to another
44
author: JasimAlrawie
55
tags: math,number-theory,algebra
66
---
77

88
```c
9-
109
float linearMapping(float value, float minIn, float maxIn, float minOut, float maxOut) {
11-
return (v-minIn) * (maxOut - minOut)/(maxIn - minIn) + minOut
10+
return (value - minIn) * (maxOut - minOut)/(maxIn - minIn) + minOut;
1211
}
1312

1413

1514
// Usage:
16-
linearMapping(value, 0, 1, 0, 255) // remaps the value from (0,1) to (0,255)
17-
linearMapping(value, 0, PI*2, 0, 360) // remaps the value from rad to deg
18-
linearMapping(value, -1, 1, 1, 8) // remaps the value from (-1,1) to (1,8)
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)
1918
```

‎snippets/javascript/mathematical-functions/linear-mapping.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
2-
title: Linear Remapping
2+
title: Linear Mapping
33
description: remaps a value from one range to another
44
author: JasimAlrawie
55
tags: math,number-theory,algebra
66
---
77

88
```js
99
function linearMapping(value, minIn, maxIn, minOut, maxOut) {
10-
return (v-minIn) * (maxOut - minOut)/(maxIn - minIn) + minOut
10+
return (value -minIn) * (maxOut - minOut)/(maxIn - minIn) + minOut
1111
}
1212

1313
// Usage:
Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
---
2-
title: Linear Renapping
2+
title: Linear Mapping
33
description: remaps a value from one range to another
44
author: JasimAlrawie
55
tags: math,number-theory,algebra
66
---
77

88
```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
911

10-
def linearMapping(value, minIn, maxIn, minOut, maxOut):
11-
return (value - minIn) * (maxOut - minOut) / (maxIn - minIn) + minOut
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)
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)
1716
```

0 commit comments

Comments
(0)

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