Linear interpolation between two points

I have two points in space(3D), and I want to slowly render a line between them. So I guess one way to this this is with linear interpolation. Using this code

private float linearInterpolate(float y1,float y2, float mu){
    return(y1*(1-mu)+y2*mu);
}

for all 3 coordinates, I get good results but not the best. When I use this method I increase mu by a constant value with each update. The problem is that this way, the line is rendered faster in bigger distances and slower in shorter distances. Any Ideas?

Calculate the distance between the two points, and divide your constant value (the one you add to mu each frame) by it.

Simple as that. This is perfect, thnx alot!