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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T08:39:36+00:00 2026-05-21T08:39:36+00:00

I develop in .NET an application that draws some lines. In the middle of

  • 0

I develop in .NET an application that draws some lines.
In the middle of a line I need to draw the line direction array.

Have:
(xA, yA, xB, yB) or (pA, pB) – segment AB points
arrWidth, arrHeight – arrow dimensions;
> B – arrow direction.

Need:
3 new points pArr1, pArr2, pArr3 – points of the directional arrow, that should be situated in the middle of the segment AB.

enter image description here

  • 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-21T08:39:36+00:00Added an answer on May 21, 2026 at 8:39 am

    First I’ll make some definitions.

    let:

    • p = position vector to tail of line
    • v = the line vector
    • h = the arrow height
    • w = the arrow width
    • L = the anti-clockwise rotation by 90 degrees

    Then your three points are:

    1. p + (|v|/2 – h/2 + w/2 L) v/|v|
    2. p + (|v|/2 – h/2 – w/2 L) v/|v|
    3. p + (|v|/2 + h/2) v/|v|

    Where v/|v| is the unit vector along your line.

    In 2 dimensions L is just the mapping (x, y) => (-y, x)

    To be more explicit, using the variables in the question, the points above could be written in C# as:

    // assuming xA, yA, xB, yB, arrWidth, arrHeight are initialised
    var xV = xB - xA;
    var yV = yB - yA;
    var v = Math.Sqrt(xV*xV + yV*yV);
    var pArr1 = new[] {
        xA + xV / 2 - xV * arrHeight / (2 * v) - yV * arrWidth / (2 * v),
        yA + yV / 2 - yV * arrHeight / (2 * v) + xV * arrWidth / (2 * v) };
    var pArr2 = new[] {
        xA + xV / 2 - xV * arrHeight / (2 * v) + yV * arrWidth / (2 * v),
        yA + yV / 2 - yV * arrHeight / (2 * v) - xV * arrWidth / (2 * v) };
    var pArr3 = new[] {
        xA + xV / 2 + xV * arrHeight / (2 * v),
        yA + yV / 2 + yV * arrHeight / (2 * v) };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a .net application that we didn't develop, but use. I can tell
i'm need to develop and web application that uses maps, and i have two
I have develop small Asp.net MVC3 application using Telerik rad Controls with in that
I need to develop own .NET off-line application which will just open a web
I have to develop an ASP.NET MVC3 application in C# and Razor that has
I have to develop a .NET C# application that supports plugins. I’ve found a
I might need to write some GUI application that runs on .Net (and Windows),
I am using asp.net MVC to develop an application that will have ajax interactions.
I have to develop an appliction (Asp.Net - maybe MVC) that would be integrated
I am trying to develop an application using ADO.NET. I have two tables in

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.