---
title: "Discussion on \"4. Bresenham's Line Algorithm in C++ using Glut\" | Hashnode"
description: "Discussion on \"4. Bresenham's Line Algorithm in C++ using Glut\". Algorithm\n\n\nCode in c++ using Glut\n#include<GL/glut.h>\n#include<math.h>\n#include<iostream>\nusing namespace std;\n\nfloat x_1,y_1,x_2,y_2;\n\nvoid Line(){\n\n    float dy, dx, m , P;\n    dy = y_2 - y_1;\n    dx = x_2 - x_1;\n\n    m = dy/dx;\n\n    P = 2*dy - dx..."
url: "https://hashnode.com/posts/4-bresenhams-line-algorithm-in-c-using-glut/6044b2635a56f82fa3ecca12"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [4\. Bresenham's Line Algorithm in C++ using Glut](https://rajkumarpatil.hashnode.dev/4-bresenhams-line-algorithm-in-c-using-glut?utm_source=hashnode&utm_medium=feed)

Algorithm Code in c++ using Glut #include<GL/glut.h> #include<math.h> #include<iostream> using namespace std; float x\_1,y\_1,x\_2,y\_2; void Line(){ float dy, dx, m , P; dy = y\_2 - y\_1; dx = x\_2 - x\_1; m = dy/dx; P = 2\*dy - dx...

Mar 7, 2021 · 2 min read · rajkumarpatil.hashnode.dev  
Read the article

## Written by

[Rajkumar V Patil](https://hashnode.com/@rajkumarpatil)

@rajkumarpatil

  
[View profile](https://hashnode.com/@rajkumarpatil)

Assistant Professor at NBN Sinhgad School of Engineering, Pune

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
