Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7909637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T12:30:42+00:00 2026-06-03T12:30:42+00:00

How do I draw a non-orthogonal line? If we have an orthogonal line it’s

  • 0

How do I draw a non-orthogonal line?

If we have an orthogonal line it’s pretty easy:

Consider X1 = 100, Y1 = 80; And X2=100, Y2 = 185;

So we have something like this for this line.

for(nRow = Y1; nRow < Y2; nRow++)
{
   for(nCol = X1; nCol < X2; nCol++)
   {
     nPixPos = nRow*nEffectiveWidth+nCol*3;

     Image[nPixPos] = 0 ; /// Image -> unsigned char * (BUFFER) || 0 -> Black COLOR
     Image[nPixPos+1] = 0 ;
     Image[nPixPos+2] = 0 ;
  }
}

If I want to draw a non-orthogonal line such as:

X1 = 100 , Y1 = 80 and X2 = 115 , Y2 = 185

How would I go about constructing a loop to draw this line?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T12:30:43+00:00Added an answer on June 3, 2026 at 12:30 pm

    You have a few algorithms to choose from I suggest Bresenham’s algorithm if you don’t want anti-aliasing and Xiaolin-Wu’s if you do.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I draw a line in a zedgraph pane, but sometimes it will be like
I have a data structure like this ( assume that the data structure is
I have a non-straight line defined by a series of x, y coordinate points.
I have an orthogonal perspective which I initialize like so: gl.glViewport(0, 0, Constants.SCREEN_WIDTH, Constants.SCREEN_HEIGHT);
My Objective-C is pretty rusty or non-existent. I'm trying to figure out how this
I am trying to have information displayed for this query: SELECT o.sub_number,o.unique_id,o.period_from,o.period_to,o.total_amt, i.paid_amt,i.dated,i.payment,i.paid_by,i.entered_date,i.paid_for_unique, j.cheque_num,j.drawn_on,j.dated
To draw a circle on map I have a center GLatLng (A) and a
I am used to XNA like structures: LoadContent Update Draw Now based on these
I have a custom control whose primary purpose is to draw data. I want
I have a following problem. A large rectangle contains smaller non-intersecting rectangles (The black

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.