New User Special Price Expires in

Let's log you in.

Sign in with Facebook


Don't have a StudySoup account? Create one here!


Create a StudySoup account

Be part of our community, it's free to join!

Sign up with Facebook


Create your account
By creating an account you agree to StudySoup's terms and conditions and privacy policy

Already have a StudySoup account? Login here

Science and Computers I

by: Ms. Bryce Wisoky

Science and Computers I PHY 307

Marketplace > Syracuse University > Physics 2 > PHY 307 > Science and Computers I
Ms. Bryce Wisoky
GPA 3.93

Jennifer Schwarz

Almost Ready


These notes were just uploaded, and will be ready to view shortly.

Purchase these notes here, or revisit this page.

Either way, we'll remind you when they're ready :)

Preview These Notes for FREE

Get a free preview of these Notes, just enter your email below.

Unlock Preview
Unlock Preview

Preview these materials now for free

Why put in your email? Get access to more of this material and other relevant free materials for your school

View Preview

About this Document

Jennifer Schwarz
Class Notes
25 ?




Popular in Course

Popular in Physics 2

This 2 page Class Notes was uploaded by Ms. Bryce Wisoky on Wednesday October 21, 2015. The Class Notes belongs to PHY 307 at Syracuse University taught by Jennifer Schwarz in Fall. Since its upload, it has received 26 views. For similar materials see /class/225624/phy-307-syracuse-university in Physics 2 at Syracuse University.

Similar to PHY 307 at Syracuse


Reviews for Science and Computers I


Report this Material


What is Karma?


Karma is the currency of StudySoup.

You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 10/21/15
Brief introduction to color in VPython MIXING COLORS Color on television screens and computer monitors is created by mixing different amounts of the 3 primary additive colors red green and blue Red is simply made by making the red pixels on the screen bright while keeping the green and blue dim Similarly it is easy to see how green and blue are made If you look at bright yellow on a monitor very closely with a magnifying glass e g you will see little red and green pixels fully lit Similarly magenta is blue and red and cyan is a mixture of green and blue More subtle shades are made from other mixtures of red R green G and blue B For example mixing maximum intensity red and half maximum intensity green and zero intensity blue gives a orange color VPython The visual library allows you to control the color of an object in several ways These methods are quite similar to controlling the position of an object in 3D space For example you can set the x attribute of an object to move it along the xaxis direction Or you can modify the whole three coordinates using the pos attribute So to move a cube named a to position x0 y1 z05 you could say ax 0 ay 1 az 05 or you could say ap0s 0 1 05 where the order is always x y z The three axes of color we will use are red green and blue To make an object orange you can say ared 1 agreen 05 ablue 0 or you could say ac010r 1 05 0 where the order is always R G B You will want to experiment with this say in a shell Just make a cube then set its red green blue and color attributes to different values between 0 dark and 1 maximum Python provides some de ned colors c010rblue is nothing but the three numbers 001 this is also called atuplet c010rgreen is 010 and c010rmagenta is l0l So when you say ac010r c010rmagenta this is equivalent to ac010r 1 0 1 For example try entering these statements one at a time in a shell from Visual import a b0x ared 0 agreen 0 ablue 0 ac010r 1 07 03 print c010rblue print c010rmagenta print c010rred print c010ryelow You can make the color dynamic same as the position Here is a program to move a box in space from x0 to x1 from Visual import a b0xc010rc010rgreen for count in range100 rate0 1 ax count 001 A simple modi cation just replacing ax with ared will not move it but instead change its color by mixing in more and more red from Visual import a b0xc010rc010rgreen for count in range100 rate0 1 ared count 001 You can use color to indicate parameter values For example you might indicate the temperature of a box using a parameter temperature from Visual import a b0xc010rc010rred temperature 1 for count in range100 rate10 temperature temperature 099 ac010r temperature 0 1 temperature If the temperature is high the color will be reddish As temperature decreases the red component will be small and the blue component will be high giving the box a bluish color


Buy Material

Are you sure you want to buy this material for

25 Karma

Buy Material

BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.


You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

Why people love StudySoup

Jim McGreen Ohio University

"Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."

Amaris Trozzo George Washington University

"I made $350 in just two days after posting my first study guide."

Bentley McCaw University of Florida

"I was shooting for a perfect 4.0 GPA this semester. Having StudySoup as a study aid was critical to helping me achieve my goal...and I nailed it!"


"Their 'Elite Notetakers' are making over $1,200/month in sales by creating high quality content that helps their classmates in a time of need."

Become an Elite Notetaker and start selling your notes online!

Refund Policy


All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email


StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here:

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.