Skip to content
This repository was archived by the owner on Jun 1, 2021. It is now read-only.

Possible bug in function getX() #7

@s6mahahn

Description

@s6mahahn

The following part is only accessible when x = 0. This should result in an error, right? Because you cant divide by 0. So either this part is useless oder will give an error at some point. Maybe you could look into that.

if(x == 0){
        double ar = ((rm1 - r1 + r - rm) + (rm - r) / x) / (x - 1);
	double as = ((sm1 - s1 + s - sm) + (sm - s) / x) / (x - 1);
	if(as > 0 | ar < 0){
		//let's assume straight lines again...
		double cr = (rm - r) / (r1 - r + rm - rm1);
		double cs = (sm - s) / (s1 -s + sm - sm1);
		x = (cr + cs) / 2; 
	}
}

I hope I am not completly stupid and looked over something.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions