I can express this programmatically, how would this be expressed mathematically?

135 Views Asked by At

So, I have a project in school where I have to make a 2 point perspective drawing and give the equations for all the lines. I would like to make a dashed line(we don't have to but I want to), so I was thinking of how to express that and I was thinking how I would do that programming and would express it as

if ((int[x]<x<int[x]+.2)==true)
    draw line

However, as I need to write everything in equations how would this be expressed mathematical notation? Would this simply be expressed as a limit?

2

There are 2 best solutions below

2
On BEST ANSWER

Another fairly common notation is to denote the "fractional part" of a number $x$ as $\{x\}$. If you used this notation, you could say that your condition is simply that $$0 < \{x\} < \frac15.$$ Note that $\{x\}$ is just $x-\lfloor x\rfloor$. So if you don't like $\{x\}$, you could also write your condition as $$0 < x-\lfloor x\rfloor < \frac15.$$

1
On

your statement of int[x] would look like$\lfloor x \rfloor$ using mathematical notation. Notice that it is not just brackets, but brackets with only the lower portion extended. It denotes the largest integer less than or equal to $x$.