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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T09:33:17+00:00 2026-05-15T09:33:17+00:00

I have to be able to set a random location for a waypoint for

  • 0

I have to be able to set a random location for a waypoint for a flight sim. The maths challenge is straightforward:

“To find a single random location within a quadrangle, where there’s an equal chance of the point being at any location.”

Visually like this:

alt text

An example ABCD quadrangle is:
A:[21417.78 37105.97]
B:[38197.32 24009.74]
C:[1364.19 2455.54]
D:[1227.77 37378.81]

Thanks in advance for any help you can provide. 🙂

EDIT
Thanks all for your replies. I’ll be taking a look at this at the weekend and will award the accepted answer then. BTW I should have mentioned that the quadrangle can be CONVEX OR CONCAVE. Sry ’bout dat.

  • 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-15T09:33:18+00:00Added an answer on May 15, 2026 at 9:33 am

    Split your quadrangle into two triangles and then use this excellent SO answer to quickly find a random point in one of them.

    Update:

    Borrowing this great link from Akusete on picking a random point in a triangle.

    main figure
    (from MathWorld – A Wolfram Web Resource: wolfram.com)

    Given a triangle with one vertex at
    the origin and the others at positions v1
    and v2, pick
    x
    (from MathWorld – A Wolfram Web Resource: wolfram.com)
    where A1
    and A2 are uniform
    variates in the interval [0,1] , which gives
    points uniformly distributed in a
    quadrilateral (left figure). The
    points not in the triangle interior
    can then either be discarded, or
    transformed into the corresponding
    point inside the triangle (right
    figure).

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

Sidebar

Related Questions

I have been able to set up OBDC in Filemaker, and added table ,
I have a table and I would like to be able to set up
I have an IOS application which uses environment variables and am able to set
I have a HTML form; I want to be able to set it so
I have the need to relatively quickly be able to determine if a set
I have a set of events that reoccur. I need to be able to
I have been able to make my photos large for single photo posts on
I have been able to find lots of examples of adding a Dropdown list
Hey guys, I am trying to have a theme set up and be able
I have been able to run my C# .net 3.5 app just fine on

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.