Skip to main content
Code Review

Return to Answer

replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

To simplify your normalization code...

First, calculate the intervals for each pair on the unnormalized data. For example, the length of the interval between [0, 360] is calculated via 360 - 0.

Second, calculate the normalized start position by using modulus. In C, calculate n mod M with ((n % M) + M) % M. (See discussion at SO SO). This could be a function.

Now, you have your data represented as (start1, interval1) and (start2, interval2). I think that's a better representation for what you want to do.

If you disagree, calculate endN via startN + intervalN to get (start1, end1) and (start2, end2).

Edit: Added info from comments.

To simplify your normalization code...

First, calculate the intervals for each pair on the unnormalized data. For example, the length of the interval between [0, 360] is calculated via 360 - 0.

Second, calculate the normalized start position by using modulus. In C, calculate n mod M with ((n % M) + M) % M. (See discussion at SO). This could be a function.

Now, you have your data represented as (start1, interval1) and (start2, interval2). I think that's a better representation for what you want to do.

If you disagree, calculate endN via startN + intervalN to get (start1, end1) and (start2, end2).

Edit: Added info from comments.

To simplify your normalization code...

First, calculate the intervals for each pair on the unnormalized data. For example, the length of the interval between [0, 360] is calculated via 360 - 0.

Second, calculate the normalized start position by using modulus. In C, calculate n mod M with ((n % M) + M) % M. (See discussion at SO). This could be a function.

Now, you have your data represented as (start1, interval1) and (start2, interval2). I think that's a better representation for what you want to do.

If you disagree, calculate endN via startN + intervalN to get (start1, end1) and (start2, end2).

Edit: Added info from comments.

deleted 11 characters in body
Source Link
Jeff
  • 161
  • 3

To simplify your normalization code...

First, calculate the intervals for each pair on the unnormalized data. For example, the length of the interval between [0, 360] is calculated via 360 - 0.

Second, calculate the normalized start position by using modulus. In C, calculate n mod M with ((n % M) + M) % M. For details, see(See discussion at SO ). This could be a function.

Now, you have your data represented as (start1, interval1) and (start2, interval2). I think that's a better representation for what you want to do.

If you disagree, calculate endN via startN + intervalN to get (start1, end1) and (start2, end2).

Edit: Added info from comments.

To simplify your normalization code...

First, calculate the intervals for each pair on the unnormalized data. For example, the length of the interval between [0, 360] is calculated via 360 - 0.

Second, calculate the normalized start position by using modulus. In C, calculate n mod M with ((n % M) + M) % M. For details, see discussion at SO. This could be a function.

Now, you have your data represented as (start1, interval1) and (start2, interval2). I think that's a better representation for what you want to do.

If you disagree, calculate endN via startN + intervalN to get (start1, end1) and (start2, end2).

Edit: Added info from comments.

To simplify your normalization code...

First, calculate the intervals for each pair on the unnormalized data. For example, the length of the interval between [0, 360] is calculated via 360 - 0.

Second, calculate the normalized start position by using modulus. In C, calculate n mod M with ((n % M) + M) % M. (See discussion at SO ). This could be a function.

Now, you have your data represented as (start1, interval1) and (start2, interval2). I think that's a better representation for what you want to do.

If you disagree, calculate endN via startN + intervalN to get (start1, end1) and (start2, end2).

Edit: Added info from comments.

added 108 characters in body
Source Link
Jeff
  • 161
  • 3

To simplify your normalization code...

First, calculate the intervals for each pair on the unnormalized data. For example, the length of the interval between [0, 360] is calculated via 360 - 0.

Second, calculate the normalized start position just by using modulus. In C, calculate n mod M with ((n % M) + M) % M. For details, see discussion at SO . This could be a function.

Now, you have your data represented as (start1, interval1) and (start2, interval2). I think that's a better representation for what you want to do.

If you disagree, calculate endN via startN + intervalN to get (start1, end1) and (start2, end2).

Edit: Added info from comments.

To simplify your normalization code...

First, calculate the intervals for each pair on the unnormalized data. For example, the length of the interval between [0, 360] is calculated via 360 - 0.

Second, calculate the normalized start position just by using %.

Now, you have your data represented as (start1, interval1) and (start2, interval2). I think that's a better representation for what you want to do.

If you disagree, calculate endN via startN + intervalN to get (start1, end1) and (start2, end2).

To simplify your normalization code...

First, calculate the intervals for each pair on the unnormalized data. For example, the length of the interval between [0, 360] is calculated via 360 - 0.

Second, calculate the normalized start position by using modulus. In C, calculate n mod M with ((n % M) + M) % M. For details, see discussion at SO . This could be a function.

Now, you have your data represented as (start1, interval1) and (start2, interval2). I think that's a better representation for what you want to do.

If you disagree, calculate endN via startN + intervalN to get (start1, end1) and (start2, end2).

Edit: Added info from comments.

Source Link
Jeff
  • 161
  • 3
Loading
lang-cs

AltStyle によって変換されたページ (->オリジナル) /