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 834265
In Process

The Archive Base Latest Questions

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

Given a series of points, how could I calculate the vector for that line

  • 0

Given a series of points, how could I calculate the vector for that line 5 pixels away? Ex:
Given:

   \
    \
     \

How could I find the vector for

   \  \
    \  \
     \  \

The ones on the right.

I’m trying to figure out how programs like Flash can make thick outlines.

Thanks

  • 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-15T04:38:49+00:00Added an answer on May 15, 2026 at 4:38 am

    A thick line is a polygon. (Let’s forget about antialiasing for now)

    picture http://img39.imageshack.us/img39/863/linezi.png

    start = line start = vector(x1, y1)
    end = line end = vector(x2, y2)
    dir = line direction = end – start = vector(x2-x1, y2-y1)
    ndir = normalized direction = dir*1.0/length(dir)
    perp = perpendicular to direction = vector(dir.x, -dir.y)
    nperp = normalized perpendicular = perp*1.0/length(perp)

    perpoffset = nperp*w*0.5
    diroffset = ndir*w*0.5

    (You can easily remove one normalization and calculate one of the offsets by taking perpendicular from the other)

    p0, p1, p2, p3 = polygon points:
    p0 = start + perpoffset – diroffset
    p1 = start – perpoffset – diroffset
    p2 = end + perpoffset + diroffset
    p3 = end – perpoffset + diroffset

    P.S. You’re the last person I ever going to explain this stuff to.
    Things like these should be understood on intuitive level.

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

Sidebar

Related Questions

Another developer has given me an algorithm that returns a series of strings that
Summary: I'm given a series of points in 3D space, and I want to
Is OpenGL, given a series of points, able to fill in a polygon or
I have a series of shapes (Approx. 50), that each have 5 points, and
I have a series of points which I will turn into a line on
If I have a given series of numbers that count up by 1, say
I am trying to create a series of divs that slowly fade into existence
I need to generate a series of N random binary variables with a given
Given that the web application doesn't have su privileges, I'd like to execute a
So I'm trying to figure out why the modulo operator is returning such a

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.