Coder Social home page Coder Social logo

grafika-computer-t2's Introduction

Devit Erlingga Arafiudin 1201220030

3.1 Derive the midpoint algorithm for drawing lines with a slope between โˆ’1 and 0.

31.png

3.2 Apply the structural algorithm in section 3.3 to draw the line in figure 3.6.

  • Tentukan titik ujung garis, (x0, y0) dan (x1, y1).
  • Hitung perbedaan antara koordinat x dan y, dx = x1 - x0 dan dy = y1 - y0.
  • Hitung nilai kemiringan rasional garis, yaitu dy/dx.
  • Gunakan persamaan garis: y = m * x + b untuk menentukan nilai b.
  • Mulai dari titik awal (x0, y0), langkah-langkahnya adalah sebagai berikut:
  • a. Hitung nilai variabel keputusan (D) berdasarkan algoritma midpoint.
  • b. Pilih piksel berikutnya yang akan digambar berdasarkan nilai D.
  • c. Perbarui posisi piksel dan nilai D, dan ulangi langkah tadi hingga mencapai titik akhir (x1, y1).
  • Dengan mengurangi operasi pada piksel yang akan digambar dan menghindari operasi pecahan, komputasi dapat dilakukan dengan menggunakan bilangan bulat saja.
  • Dengan memanfaatkan pendekatan ini, garis dapat digambar menggunakan algoritma struktural dengan langkah-langkah yang telah diuraikan sebelumnya.

3.3 Extend the program GeneralPathCar.java for drawing the car of figure 2.10.

  • Show the control points for the quadratic and cubic curves.
  • Connect the endings of the curves with their corresponding control points by dashed lines.

33.png

grafika-computer-t2's People

Contributors

devit7 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.