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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:39:15+00:00 2026-05-13T13:39:15+00:00

Given two points, A and B, defined by longitude and latitude I want to

  • 0

Given two points, A and B, defined by longitude and latitude I want to determine if another point C is ~between~ A and B. ~between~ is hard for me to define. I don’t mean on the line – it almost certainly won’t be.

Geometric diagram http://www.freeimagehosting.net/uploads/b5c5ebf480.jpg

In this diagram, point C is ~between~ A and B because it is between the normals of points A and B and the line between them (normals denoted by thin line). Point D is not ~between~ A and B but it is ~between~ B and F.

Another way of saying this is that I want to determine if the triangles ABC and ABD are obtuse or not.

Note that the points will be very close together – within 10s of metres normally.

I’m thinking that the law of haversines may help but I don’t know what the inverse of haversine is.

Many thanks for all help.

  • 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-13T13:39:15+00:00Added an answer on May 13, 2026 at 1:39 pm

    First, start with translating your points to local tangent plane. We will use the fact that your triangles are much smaller than the earth’s radius. (Tangent space is such that equal deltas in each of the two coordinates correspond to equal distances)

    This is done by dividing longtitudes by sin(lat):

    A_local_x = A_lat_rads;
    A_local_y = A_lon_rads/sin(A_lat_rads);
    

    Then,

    Compute lengths:

    double ABsquared = (A_local_x - B_local_x)*(A_local_x - B_local_x) + (A_local_y - B_local_y)*(A_local_y - B_local_y);
    double BCsquared = ..., ACsquared.
    

    Finally:

    bool obtuse = (ABsquared+BCsquared < ACsquared) || (ABsquared+ACsquared < BCsquared); 
    

    Obtuse means “it is not within the line”, as you say. I am not checking whether triangle ABC is obtuse, but whether the angles at B and at A are obtuse. That’s it.

    note: I haven’t tested this code. Please tell me how it works by plugging different points, if there’s a bug I will fix it.

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

Sidebar

Related Questions

Given two points P,Q and a delta, I defined the equivalence relation ~=, where
Given two points in 3D space, A and B, I get a line segment
Given two date ranges, what is the simplest or most efficient way to determine
Given two floating-point numbers, I'm looking for an efficient way to check if they
Given a point P on a 'canonical' ellipse defined by axes a, b ,
i want to to calculate minimum sum in given two dimensional array #include<iostream> #include<limits.h>
A line is defined by two end points P1[x1, y1], P2[x2, y2]. Let Q
Given two points on a webpage and a set of DOM elements, how to
Given any two points on compass (Start range and End Range) to form a
Given two integers a and b , how would I go about calculating the

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.