GithubHelp home page GithubHelp logo

chanceyu / front-end-math Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 315 KB

:triangular_ruler: Mathematics code snippets. https://chanceyu.github.io/front-end-math/

License: MIT License

HTML 100.00%
front-end javascript math mathematics

front-end-math's Introduction

๐‡๐ž๐ฅ๐ฅ๐จ ๐ญ๐ก๐ž๐ซ๐ž, ๐Ÿ๐ž๐ฅ๐ฅ๐จ๐ฐ <๐šŒ๐š˜๐š๐šŽ๐š›๐šœ/>!

front-end-math's People

Contributors

chanceyu avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

front-end-math's Issues

ใ€Šๆฑ‚็›ด่ง’ไธ‰่ง’ๅฝข็š„่ง’ๅบฆใ€‹ไธ€ๆ–‡ไธญ็š„่ฎก็ฎ—ๅ…ฌๅผ็–‘ไผผๅ‡บ้”™

็ป™ๅฎšๅๆ ‡:

x1 = 300 y1 = 250
 x2 = 580 y2 = 220

ไปฃๅ…ฅๅ…ฌๅผ

let angle = Math.round(180 / Math.PI * Math.acos((y1 - y2) / Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2))))

ๅพ—ๅ‡บ็š„็ป“ๆžœๆ˜ฏ 83๏ผŒไฝ†ๆ˜ฏๆญฃ็กฎ็š„็ป“ๆžœๅบ”ไธบ 6
ๅŽๆฅๆˆ‘ไปฅไธ‹ๅ…ฌๅผๆ‰ๅพ—ๅ‡บๆญฃ็กฎ็š„็ญ”ๆกˆ

let x = x1 > x2 ? x1 - x2 : x2 - x1
let y = y1 > y2 ? y1 - y2 : y2 - y1
let angle = Math.round(Math.atan2(y, x) / (Math.PI / 180))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.