GithubHelp home page GithubHelp logo

liulinboyi / visualization-of-learning-front-end Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 153 KB

Visualization of learning front end,学习可视化

Home Page: https://blog.heyliubo.top/Visualization-of-learning-front-end/

HTML 33.51% JavaScript 66.49%
vsualization

visualization-of-learning-front-end's Introduction

跟月影学可视化

随堂例子合集

SVG Dom结构

// 生成多边形顶点坐标数组的函数
function createCircleVertex(x, y, r, n) {
  const sin = Math.sin;
  const cos = Math.cos;
  const perAngel = (2 * Math.PI) / n; // 这里n为4的话,是弧度制2PI / 4 => PI / 2 单位长度
  console.log(perAngel, 'perAngel');
  const positionArray = [];
  for (let i = 0; i < n; i++) {
    const angel = i * perAngel; // i 取值 0,1,2,3 => 0,PI / 2,PI,3*PI / 2
    const nx = r * cos(angel); // 半径为0.5 
    const ny = r * sin(angel);
    console.log([nx, ny], `PI * ${2 / n * i}`);
    positionArray.push(nx, ny);
  }
  // return new Float32Array(positionArray);
  return positionArray;

}
// 正八边形 
const points = createCircleVertex(0, 0, 0.5, 8);

图片详解:

visualization-of-learning-front-end's People

Contributors

liulinboyi avatar

Watchers

 avatar  avatar

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.