Digital and discrete : geometry theory and algorithms