View Single Post
  #1   Spotlight this post!  
Unread 01-04-2015, 20:29
Brandon_L Brandon_L is offline
doot doot
AKA: Brandon Liatys
no team
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Newark, NJ
Posts: 1,189
Brandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond reputeBrandon_L has a reputation beyond repute
[TBA]: Incorrect qual points

Seems like TBA is incorrectly calculating the district qual points for each event. I'm not sure if its been noticed or if a fix is in the works or what TBA is even coded in, but I was messing around in php and got it running. If you'd like to steal the code and port it over to whatever you guys use, works for me.

PHP Code:
function qual_points($n$r){
        
$a=1.07;
        return 
ceil((inverf(($n-(2*$r)+2)/($a*$n))*(10/(inverf(1/$a))))+12);
    }
    
    function 
sign($number) {
        return ( 
$number ) ? : ( ( $number ) ? -);
    }
    
    function 
inverf($x) {
        
$a=0.147;
        return 
sign($x)*sqrt(sqrt(pow(((2/(pi()*$a))+((log(1-pow($x2)))/2)), 2) - ((log(1-pow($x2)))/$a) )-((2/(pi()*$a))+(log(1-pow($x2)))/2));
    } 
*credit to my bro paul for some help

called with qual_points(n,r) where n=the number of teams at the event and r=rank

the formula I'm using for inverf(x) comes from an approximation found on wikipedia



These incorrect calculations currently up are messing with a project I'm currently working on with the API, so I don't know if there is anything else I can do to help sort it out but please let me know.
__________________
FRC 2495 - Hamilton West Robotics [2007-2014]
FRC 3929 - Atomic Dragons [2012-2013]

Back for 2017!

Last edited by Brandon_L : 02-04-2015 at 00:06.
Reply With Quote