reorganize directory and file structure
This commit is contained in:
parent
1d826ea8d4
commit
48390b8556
99 changed files with 1155 additions and 1629 deletions
23
extra/point/nominal.js
Normal file
23
extra/point/nominal.js
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
export const cart2polar = ({x, y}) => {
|
||||
const r = Math.sqrt(x*x + y*y);
|
||||
const θ = Math.atan(y/x);
|
||||
return {r, θ};
|
||||
};
|
||||
|
||||
export const polar2cart = ({r, θ}) => {
|
||||
const x = r * Math.cos(θ);
|
||||
const y = r * Math.sin(θ);
|
||||
return {x, y};
|
||||
}
|
||||
|
||||
export const translate = dx => dy => ({x, y}) => {
|
||||
return {left: x+dx, right: y+dy};
|
||||
}
|
||||
|
||||
export const rotate = dθ => ({r, θ}) => {
|
||||
return {r, θ: θ+dθ};
|
||||
}
|
||||
|
||||
export const scale = dr => ({r, θ}) => {
|
||||
return {r: r+dr, θ};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue