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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:25:53+00:00 2026-06-14T21:25:53+00:00

I have vectors on a canvas which display a heading. I also calculated the

  • 0

I have vectors on a canvas which display a heading.
I also calculated the current heading with which the user is moving his mouse.

When he moves over vectors, i only want to select those that match the heading of the users mouse movements.

e.g. consider vector 1 has 180 degree heading
the user moves his mouse and has an approx heading of 170.

Since the user cannot exactly match the vectors heading, i want to add a margin.

E.g. is heading of vector between (170 – 45) and (170 + 45) ?

The problem arises when the vector has a heading e.g. 350 and the users mouse has a heading of 10 – that would be between (10-45) and (10+45) – now obviously -35 is not good so i add 360 degrees again, in this case 325 < 350 but 350 is not > 55

I obviously need some deeper understanding how to calculate this case.

tldr:

Given degree X, how to measure if it is between degree A and B if you imagine a circle.

  • 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-06-14T21:25:54+00:00Added an answer on June 14, 2026 at 9:25 pm

    Use the difference. Subtract the actual heading from your desired heading. While the answer is <=-180 or >180, add or subtract 360 as appropriate. Then compare the result to your error band (in your example >-45, <45)

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

Sidebar

Related Questions

I have a Canvas that contains a button which I want to be able
I have three vectors which are orthogonal b_vect = [1 2] L_vect = [10
I have an android program which draws lines and text to a canvas. (These
I have 2 vectors, which contain, let's say Person (name, surname, etc) objects. I
I have a html page in which I made some animations with the vectors
What I have: Vectors of different custom structs(one custom struct per vector) I used
I have two vectors, v1 and v2. I would like to find any of
I have two vectors, v1 and v2 v1 <- c('one', 'two', 'three') v2 <-
I have 3 vectors , one for angles of Phi , another for angles
I have 2 vectors and single a number. a <- rnorm(40,10,4) d <- rep(0,length(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.