Questions tagged [closest]

Closest is being the nearest to a number, object, quantity etc.

Given a number of objects, the closest 2 objects would be those that the between them is the shortest.

561 questions
3
votes
3 answers

R: find the closest observation to averages

I have a table with description statistics (means for a, b and c) per type ### stats type <- c("a","b","c","d","e","f","g","h","i","j","k","l") mean_a <- c(0,1,1,0,2,2,0,4,4,0,5,5) mean_b<- c(4,7,8,0,3,10,5,4,7,0,1,6) mean_c<-…
Floni
  • 475
  • 2
  • 13
3
votes
2 answers

Jquery : Get the index of non-siblings elements of the closest class

I'm trying to get the index of a non sibling input[type='text'] element within a particular class. Here is the code :
-> expected value 0 -> expected…
user1719210
  • 310
  • 3
  • 11
3
votes
1 answer

Distance between a ray and a Bound Box

I have researched a lot and have found codes about: Distance from a point to a Bound Box Distance between two Bound Box Intersection of a ray in a Bound Box But what I'm looking for is: Distance of a ray to a Bound Box Considering the Bound Box…
Mano-Wii
  • 592
  • 5
  • 19
3
votes
3 answers

jQuery next, parent, closest

HTML:
  • header

Click event on images must trigger a click event on the related h2. The html…
Babulaas
  • 761
  • 3
  • 13
  • 47
3
votes
1 answer

Solving a cubic to find nearest point on a curve to a point

Ok, I have a projectile that has its position defined such that: a.x = initialX + initialDX * time; a.y = initialY + initialDY * time + 0.5 * gravtiy * time^2; I want to be able to predict which obstacles in my environment this projectile will…
Tech-no
  • 31
  • 3
3
votes
1 answer

index of closest points between two sorted arrays of coordinates

I am working on an optimization problem in javascript. I have two arrays: dataset1 = [[x1,y1],[x2,y2],...,[xn,yn]] dataset2 = [[z1,w1],[z2,w2],...,[zm,wm]] dataset1 and dataset2 represent monotonic functions x1 < x2 < ... < xn (x…
Idrees Samim
  • 463
  • 5
  • 15
3
votes
1 answer

How to find the closest time value to a given time value in matlab

Say that I have a time value given, for example: 2012-03-28_15:10:00 and then I have a sting that stores multiple time…
user3366536
  • 151
  • 1
  • 2
  • 7
3
votes
1 answer

jquery add class on input click and remove class when click other input

I need to add a class to the input wrapper when I click on input, and remove the class when other input is clicked. I've tiyed toggleClass but it would only remove the class when the same input is clicked again. I've tried to use functions: find()…
mlclm
  • 725
  • 6
  • 16
  • 38
3
votes
1 answer

How to find closest table jQuery

I am trying to get the closest table when I search for a value. This is my code but I always get 'undefined'. jQuery : $(function() { $("#searchValue").keyup(function() { alert($(this).closest('table').attr('id')); }); …
David
  • 840
  • 6
  • 17
  • 37
3
votes
2 answers

Why can't I trigger the submit button's closest form?

Why can't I trigger the submit button's closest form in this example below? html, Username:
Run
  • 54,938
  • 169
  • 450
  • 748
3
votes
2 answers

Android : SQLite : Find closest value from a table

I have a SQLite Database on my app and it is setup like this: id Value1 Value2 1 12.51 10 2 14.62 20 3 18.94 30 4 21.07 40 I would like to have a code to search on the Value1 column for the closest value to the input and return…
3
votes
5 answers

jQuery: Click select Previous / Closest div with selector

I’ve being sitting for some while trying to solve a issue which I’m certain is quite simple but it just can’t get it to work. I got this HTML:
Emil Devantie Brockdorff
  • 4,724
  • 12
  • 59
  • 76
3
votes
2 answers

How to find the nearest points to given coordinates with MATLAB?

I need to solve a minimization problem with Matlab and I'm wondering which is the easiest solution. All the potential solutions that I've been thinking in require lot of programming effort. Suppose that I have a lat/long coordinate point (A,B), what…
cardogar
  • 359
  • 1
  • 4
  • 17
3
votes
2 answers

Find the nearest elements across several arrays

Say I have two arrays : a=[10 21 50 70 100 120]; b=[18 91]; I want to match the (single) element across a and b that are closest AND within 10 units away. Result : idxa=[1 2 3 4 5 6] idxb=[2 5] where the matching elements share the same number. I…
stuppie
  • 384
  • 1
  • 8
  • 18
3
votes
2 answers

SQL Join tables on Time Between Start and End

I have two tables: Events (ID, Name, Time, Recorder) Video (ID, StartTime, EndTime, Recorder, Filename) I wish to join the Event data to the video data, so that for every event I get the video filename. The recorder field is used to specify which…
Simon
  • 9,197
  • 13
  • 72
  • 115