Click here to Skip to main content
15,867,835 members
Please Sign up or sign in to vote.
1.89/5 (3 votes)
See more:
JavaScript
function findMostDistantPointFromBaseLine(baseLine, points) {
    var maxD = 0;
    var maxPt = new Array();
    var newPoints = new Array();
    for (var idx in points) {
        var pt = points[idx];
        var d = getDistant(pt, baseLine);
        
        if ( d > 0) {
            newPoints.push(pt);
        } else {
            continue;
        }
        
        if ( d > maxD ) {
            maxD = d;
            maxPt = pt;
        }
    
    } 
    return {'maxPoint':maxPt, 'newPoints':newPoints}
}
Posted
Updated 26-Nov-14 10:05am
v3
Comments
Sergey Alexandrovich Kryukov 26-Nov-14 15:22pm    
Sorry, this is not a question. ("Can anyone help?" cannot be counted as a question, of course. Help with what?)
Note that "JS function to PHP" doesn't mean anything. Javascript functions and PHP don't work together. PHP works when those functions don't yet exist; they only appear on the client side (and the Javascript code can be generated by PHP, of course).
—SA
nice_hand23 2-Dec-14 12:43pm    
absolutely true @Sergey.
But maybe he thougt about something like AJAX:
w3schools[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900