1

This post is part of the Color Meaning Blog Series, detailing the meanings associated with colors such as red, orange, yellow, green, blue, purple, grey, black, white, brown, pink, turquoise, gold, silver, and beige.

Yellow, the color of sunshine, hope, and happiness, has conflicting associations. On one hand yellow stands for freshness, happiness, positivity, clarity, energy, optimism, enlightenment, remembrance, intellect, honor, loyalty, and joy, but on the other, it represents cowardice and deceit. A dull or dingy yellow may represent caution, sickness, and jealousy.

Studies show that the meaning of the color yellow can be warmth, cheerfulness, increased mental activity, increased muscle energy. The color yellow helps activate the memory, encourage communication, enhance vision, build confidence, and stimulate the nervous system.

1
  • What are you expecting distance % math.sqrt(2) to do, and under what conditions do you expect the result to be <= 0? Commented Jun 22, 2020 at 1:54

1 Answer 1

2

i am no python programmer but just looking at your collide function

assuming that your colliding base on distance between 2 points on a 2D plane

after getting the distance, you did a (distance mod the sqrt of 2).

a mod get your the remainder of a division, to be exactly 0 means that your number will be a multiple of sqrt2, and since in computer science a floating point 0 is almost impossible to get due to how floating points values is stored.

and after your check whether formula is getting your 0 OR an negative number. since sqrt will never get a negative value from your distance formula for your collide to be true it has to be 0.

suggestion for change, after getting the distance,

Do a check whether it falls within a RANGE with each, if it is true, else false.

google: circle to point collision, my syntax maybe wrong as i am a primarily c programmer ,hope it helps

Sign up to request clarification or add additional context in comments.

2 Comments

Hey! Thanks, is it possible for you to write out in code the part that you are saying. I am not sure I fully understand and visualize your wording. If you can, it would help a lot! Thanks
Well, here is a hint: in plain English, what is the rule you are trying to implement? Under what conditions should the function return true? What does distance represent, and why is the math.sqrt(2) result relevant to what you are doing?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.