Giter Club home page Giter Club logo

angle's Introduction

일단 각에는 3가지 모드가 있을 수 있습니다. 더있을 수는 있지만 지금은 3가지만 구현합니다.

초기자에서 모드를 결정하도록 하고 default 는 Game 모드로 합니다.

  • Infinite : 스크류 드라이버처럼 회전수가 중요한 의미를 가질 경우 무한한 각을 표시할 수 있어야 합니다. 처음 위치에서의 절대 각을 표현함
  • Game : 게임에서 유닛의 방향처럼 회전수는 의미가 없고 가리키는 방향이 의미가 있을 경우 [0, 2π) 사이의 값 만이 의미가 있습니다. 이름을 direction 으로 수정?
  • Steer : 물체의 이동 방향 변경할 때는 현재 진행방향에서 변화될 각을 더해주면 되는데 이때는 [-π, π) 사이의 값만이 의미가 있습니다.

extension 은 Double 이 아니라 NumberType 자체에 할 수 있도록 합니다.

참고 자료

Angle 을 비슷하게 구현했던 링크들을 연결합니다. 수학 기호 타입에 대해서도 링크를 연결합니다.

|...| 로 절대값을 반환하도록 만들어 봅니다.

Angle 타입이 ExpressibleByFloatLiteral 를 따를 필요는 없는 것 같습니다. 반대로 CGFloat 등이 Angle 을 가지고 생성할 수 있도록 확장되어야 합니다.

같은 Angle 타입 값 끼리는 radian, degree 상관없이 산술 계산을 할 수 있습니다.

타입이 결정되지 않는 임의의 수가 Angle 타입과 엮이지 않도록 막아줍니다.

angle's People

Contributors

xho95 avatar

Watchers

 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.