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

  • Home
  • SEARCH
  • 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 859109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:38:04+00:00 2026-05-15T08:38:04+00:00

I need to paint the line which links two points. I am doing it,

  • 0

I need to paint the line which links two points.

I am doing it, in Java. I receive two points as parameters and I have to calculate if the straight line between them, is inside the black figure.

I developed my own solution using the straight line equation, but my results are different than using the “professional” programs (such as GIMP or even MS Paint).

Here is a example of what I want:

alt text http://img411.imageshack.us/img411/788/img1q.png

But my algorithm does this:

alt text http://img267.imageshack.us/img267/1908/img2d.png

*The green point is out of the figure and this is not possible.

Any ideas? Anyone know which code is been using for this, in “professional” apps?

Thanks!
Daniel.

EDIT: Images

  • 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-05-15T08:38:04+00:00Added an answer on May 15, 2026 at 8:38 am

    It looks like you are truncating instead of rounding to the nearest pixel. Difficult to see on those small black ink splotches. Could you post the code?

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

Sidebar

Related Questions

I have a paint application that runs as a Java applet. I need to
For my application I need to calculate an angle between two different lines: 1)
I have a large text file I need to sort in Java. The format
I have a model called NoteCategory, which is functioning as a join table between
I have a long list of domain names which I need to generate some
i have a input tag which is non editable, but some times i need
I have list of substrings which I need to match within a list of
I have a DateTime object that I need to print in a custom gridlike
I am aware that Dijkstra's algorithm can find the minimum distance between two nodes
My web app, up until this point, has been fairly straight forward. I have

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.