Posts

Showing posts from July, 2020

What are Homogenous coordinates?

What are Homogenous coordinates? If w == 1, then the vector (x,y,z,1) is a position in space. If w == 0, then the vector (x,y,z,0) is a direction. (In fact, remember this forever.) What difference does this make ? Well, for a rotation, it doesn't change anything. When you rotate a point or a direction, you get the same result. However, for a translation (when you move the point in a certain direction), things are different. Homogeneous coordinates allow us to use a single mathematical formula to deal with these two cases.

What is Parallel Projection?

What is Parallel Projection? Simplest type of projection, in which 3D points are mapped to 2D by moving them along a Projection Direction until they hit an image plane. The View that is produced is determined by the choice of projection direction and image plane. Parallel Projections are often used for mechanical and architectural drawings because they keep parallel lines parallel and they preserve the size and shape of planar objects that are parallel to the image plane.

What is Projection Direction?

What is Projection Direction? Points on an object are moved along imaginary lines until they hit an Image Plane.

When projection lines are parallel and perpendicular to the image plane, the resulting views are called ....?

When projection lines are parallel and perpendicular to the image plane, the resulting views are called ....? Orthographic

What is Perspective Projection?

What is Perspective Projection? Projecting along lines that pass through a single point; the Viewpoint, rather than along parallel lines. In this way objects farther from the viewpoint naturally become smaller when they are projected. A perspective view is determined by the choice of viewpoint (rather than projection direction) and image plane. As with parallel views there are oblique and non-oblique perspective views; the distinction is made based on the projection direction at the center of the image.

What is the difference between Orthographic Projection and Oblique Projection?

What is the difference between Orthographic Projection and Oblique Projection? If the Image Plane is perpendicular to the View Direction, the projection is called Orthographic. If it is not perpendicular to the View Direction, it is called Oblique.

What is Distribution Ray Tracing?

What is Distribution Ray Tracing? A powerful extension to the basic Ray-Tracing idea in which multiple random rays are sent through each pixel in an image to produce images with smooth edges and to simply (yet slowly) produce a wide range of effects from soft shadows to camera depth-of-field.

What is Linear Perspective?

What is Linear Perspective? The standard approach to make images for Computer Graphics, where 3D objects are projected onto an image plane in such a way that straight lines in the scene become straight lines in the image. A type of perspective used by artists in which the relative size, shape, and position of objects are determined by drawn or imagined lines converging at a point on the horizon.

What is the pseudo-code for the structure of a Ray Tracing program?

What is the pseudo-code for the structure of a Ray Tracing program? For each pixel, do Compute Viewing Ray Find 1st object hit by ray and its surface normal n Set pixel color to value computed from hit point, light, and surface normal n.

What is Ray Tracing?

What is Ray Tracing? An Image-Order Rendering algorithm for making renderings of 3D scenes. Rendering technique that creates photo-realistic images by simulating light's effects on materials.

How does a Ray Tracer work?

How does a Ray Tracer work? By computing one pixel at a time, and for each pixel the basic task is to find the object that is seen at that pixel's position in the image. Each pixel "looks" in a different direction, and any object that is seen by a pixel must intersect the Viewing Ray, a line that emanates from the viewpoint in the direction that pixel is looking.

Once an object is found by the Viewing Ray, what happens?

Once an object is found by the Viewing Ray, what happens? A Shading computation uses the: 1. Intersection point 2. Surface normal 3. And other information (depending on the desired type of rendering) to determine the color of the pixel.

What are the 3 parts to a Ray Tracer?

What are the 3 parts to a Ray Tracer? 1. Ray Generation: Computes the origin and direction of each pixel's Viewing Ray based on the camera geometry. 2. Ray Intersection: Finds the closest object intersecting the Viewing Ray 3. Shading: Computes the pixel color based on the results of Ray Intersection.

Rendering can be organized in 2 general ways:

Rendering can be organized in 2 general ways: 1. Object-Order Rendering: Each object is considered in turn, and for each object all the pixels that it influences are found and updated. 2. Image-Order Rendering: Each pixel is considered in turn, and for each pixel, all the objects that influence it are found and the pixel value computed.

Broadly speaking, which of the Order-Rendering methods is simpler to get working and more flexible in the effects that can be produced, but usually takes much more execution time?

Broadly speaking, which of the Order-Rendering methods is simpler to get working and more flexible in the effects that can be produced, but usually takes much more execution time? Answer: Image-Order Rendering

What is Rendering?

What is Rendering? Taking a Scene (or Model) composed of many geometric objects arranged in 3D space and producing a 2D image that shows the objects as viewed from a particular viewpoint. One of the basic tasks of computer graphics. It is the same operation that has been done for centuries by architects and engineers creating drawings to communicate their designs to others.

Fundamentally, rendering is a process that takes as its input .... and produces as its output .... ?

Fundamentally, rendering is a process that takes as its input .... and produces as its output .... ? A set of objects. An array of pixels. One way or another, Rendering involves considering how each object contributes to each pixel.

What is Rendering?

What is Rendering? Taking a Scene (or Model) composed of many geometric objects arranged in 3D space and producing a 2D image that shows the objects as viewed from a particular viewpoint. One of the basic tasks of computer graphics. It is the same operation that has been done for centuries by architects and engineers creating drawings to communicate their designs to others.

What are the five most notable threats facing the enterprise in 2017?

What are the five most notable threats facing the enterprise in 2017? 1. Reverse Deception Tactics - Tools like anti-analysis code, steganography, and command-and-control servers are being used to hide stolen data, the release said. 2. Sophisticated Phishing Campaigns - Phishing emails, often used to deliver malware, are becoming more sophisticated with the addition of specific company information regarding billing, logistics, and more. 3. Strategic Use of Information Operations - Cyberattacks and cyberespionage are growing tools used by nation-states and other actors to achieve political disruption. 4. Alternative Crypto-Currencies - Bitcoin's popularity is forcing cybercriminals to improve their laundering techniques, or adopt different cryptocurrencies altogether. 5. DDoS-for-Hire Services - Easy-to-use and affordable tools have made it easier than ever for attackers to offer Distributed denial of service (DDoS)-for-hire services.

Interview Questions on Augmented Reality? Basic Questions.

What is the definition of Augmented Reality? A computer generated image that adds to and mixes with reality. How deos PS Vita use AR, and how is this different from the VR of XBOX Kinect? PS Vita allows you to see the world through the device and shows an added layer e.g. angry birds. With Kinect it is virtual because the images are entirely in your TV. What is location based AR and how does it help businesses? With apps like Layar, it can show you locations of stores and restaurants nearby by adding a layer to the real world. How is AR used in education? Solar System, Magic Book, Chemistry-building atoms, Body Slicer. Why does AR need a "killer app"? To move beyond disillusionment

Questions on Augmented Reality + Vuforia. With Answers.

What is Vuforia? The Vuforia Engine is the most widely used platform for AR development, with support for leading phones, tablets, and eye-wear. Developers can easily add advanced computer vision functionality to Android, iOS, and UWP apps, to create AR experiences that realistically interact with objects and the environment. The Vuforia Engine Library is also organized by major feature categories. The major feature categories are Images, Objects and Environments. What is a reco? A "reco" occurs when your app recognizes a target in your Cloud Database. What are Model Targets? Allow you to recognize objects by shape using preexisting 3D models. Place AR content on a wide variety of items like industrial equipment, vehicles, toys, and home appliances. What are Image Targets? Attach content onto flat images, such as print media and product packaging. What are Object Targets? Created by scanning an object. They are a good option for toys and other products with rich surface detai...

What is a Normal Map Shader?

What is a Normal Map Shader? It provides a way to make your objects look more detailed and realistic, without having to actually increase the complexity of the models.

In a Normal Map, how are the Normals stored?

In a Normal Map, how are the Normals stored? The Normals are stored as Colors in the texture, so to get the Normal at a certain point on the object, we would sample the normal map at the relevant point and that will give us an RGB color where each value is between 0 and 1. However, the XYZ components in a Normal vector can be between -1 and 1. So a conversion is to multiple them by 2 and subtract 1. We now have 3 values between -1 and 1.

The Fragment Shader runs once for every...?

The Fragment Shader runs once for every...? Pixel that needs to get Rasterized.

What is a Uniform?

What is a Uniform? A uniform is a GLSL global variable declared with the "uniform" variable name. These act as parameters that the user of a shader program can pass to the shader program. They are stored in a program object. Uniforms are so named because they do not change from one execution of a shader program to the next within a particular rendering call. This makes them unlike shader stage inputs and outputs, which are often different for each invocation of a program stage.

What does Attenuation mean?

What does Attenuation mean? The reduction of the force, effect, or value of something.

What is a Layout qualifier?

What is a Layout qualifier? Layout Qualifiers affect where the storage for a variable comes from, as well as other user-facing properties of a particular definition. For instance: layout (location=0) in vec3 position; means that no matter what "position" is called, it is still the same variable.

How does the Normal Map Texture work?

How does the Normal Map Texture work? A Normal Map is a texture which specifies the surface normal that should be used for every single point on the object's surface.

What is the Vertex Processing Stage?

What is the Vertex Processing Stage? Transforms the primitives into screen space, optionally doing other processing, such as vertex color computation, along the way. The specific operations can be customized by vertex shaders.

What is the Rasterization Stage?

What is the Rasterization Stage? Takes the screen-space triangles resulted from vertex processing and generates a fragment for every pixel that's covered by each triangle. It also interpolates parameter values, such as colors, normals, and texture coordinates, given by the vertex processing stage, to create smoothly varying parameter values for the fragments. Depending on the design of the Rasterizer, it may clip the primitives to the view volume.

What is the Fragment Processing Stage?

What is the Fragment Processing Stage? Processes the fragments to determine the final color of each pixel. It performs z-buffering for hidden surface removal and writes the results into the frame buffer.

For each Vertex that we want to draw, the ___ Shader is used. So if we wanted to draw a triangle, it would be called ___ times.

For each Vertex that we want to draw, the ___ Shader is used. So if we wanted to draw a triangle, it would be called ___ times. Vertex Shader 3 times, one for each Vertex.

The primary job of the Vertex Shader is to tell OpenGL...?

The primary job of the Vertex Shader is to tell OpenGL...? Where you want the Vertex to be in your screen space.

What is the Application Stage?

What is the Application Stage? Holds the scene being rendered in some appropriate data structure, and sends a series of primitives to the pipeline for rendering.

What is the Graphics Pipeline?

What is the Graphics Pipeline? A sequence of processing stages that efficiently transforms a set of 3D primitives into a shaded rendering from a particular camera viewpoint.

What are the major stages of the Graphics Pipeline?

What are the major stages of the Graphics Pipeline? 1. Application 2. Vertex Processing 3. Rasterization 4. Fragment Processing 5. Display

List six items used in the 9th Sub-system of the LaCoste System.

List six items used in the 9th Sub-system of the LaCoste System. 1) Whip 2) Sarong 3) Belt 4) Rope 5) Chain

List five items used in the 10th Sub-system of the LaCoste System

List five items used in the 10th Sub-system of the LaCoste System 1) Dagger 2) Rocks 3) Spears 4) Peppers

List the 12 Sub-systems of the LaCoste System of Filipino Martial Arts

List the 12 Sub-systems of the LaCoste System of Filipino Martial Arts 1) Single Stick 2) Double Stick 3) Stick and Dagger 4) Double Dagger 5) Single Dagger 6) Palm Stick 7) Empty Hand 8) Staff 9) Flexible Weapons 10) Hand Thrown Projectiles 11) Mechanical Projectiles 12) Spiritual, Healing arts, Dance

List four weapons used in Sub-system #1

List four weapons used in Sub-system #1 1) Axe 2) Cane 3) Sword 4) ?

List four combinations of weapons use in Sub-system

List four combinations of weapons use in Sub-system  1) Sword and Dagger 2) Sword and Shield 3) Sword and Stick 4) Axe and Dagger

The 7th Sub-system in the LaCoste System of the Filipino Martial Arts is the Pangamut section. List the Five Main Areas of Concentration.

The 7th Sub-system in the LaCoste System of the Filipino Martial Arts is the Pangamut section. List the Five Main Areas of Concentration. 1) Panatukan 2) Kinamutie 3) Dumog 4) Hubud 5)Sekorong

List four weapons used in the 8th Sub-system of the LaCoste System.

List four weapons used in the 8th Sub-system of the LaCoste System. 1) Spear 2) Oar 3) Paddle 4) Staff

List seven ways of training in the LaCoste System

List seven ways of training in the LaCoste System 1) Abecedario 2) Sumbrada 3) Blending of the first two 4) Solo Training/Karensa 5) Sparring 6) Hitting Objects 7) Imagination

By itself, the ability to project points from the world to the image is only good for producing...?

By itself, the ability to project points from the world to the image is only good for producing...? Wireframe Renderings - renderings in which only the edges of objects are drawn, and closer surfaces do not occlude more distant surfaces.

Viewing Transformation's can be broken up into a sequence of 3 transformations which are...?

Viewing Transformation's can be broken up into a sequence of 3 transformations which are...? 1. Camera Transformation / Eye Transformation 2. Projection Transformation 3. Viewpoint Transformation / Windowing Transformation

What is a Camera / Eye Transformation?

What is a Camera / Eye Transformation? A Rigidbody Transformation that places the camera at the origin in a convenient orientation. It depends only on the position and orientation, (AKA Pose) of the camera.

What is a Projection Transformation?

What is a Projection Transformation? Transformation that projects points from camera space so that all visible points fall in the range -1 to 1 in x and y. It depends only on the type of projection desired.

What is a Viewport/Windowing Transformation?

What is a Viewport/Windowing Transformation? Transformation which maps this unit image rectangle to the desired rectangle in pixel coordinates. It depends only on the size and position of the output image.

While there are many ways to make images, the standard approach is...?

While there are many ways to make images, the standard approach is...? Linear Perspective, in which 3D objects are projected onto an image plane in such a way that straight lines in the scene become straight lines in the image.

What is the difference between orthographic and perspective views?

What is the difference between orthographic and perspective views? Orthographic is like a blueprint in that it shows everything flat and "as is." It looks like if you took everything and stuck it against the camera. Perspective is modelling the scene as if you were looking at it with the human eye. Same length lines could appear different due to foreshortening, etc.

Besides arranging geometric objects in 2D or 3D space, Matrix Transformations can also be used as a tool to....?

Besides arranging geometric objects in 2D or 3D space, Matrix Transformations can also be used as a tool to....? Move objects between their 3D locations and their positions in a 2D view of the 3D world.

What is OpenGL?

What is OpenGL? A software interface to graphics hardware. Wiki: Open Graphics Library (OpenGL) is a cross-language, cross-platform application programming interface (API) for rendering 2D and 3D vector graphics. The API is typically used to interact with a graphics processing unit (GPU), to achieve hardware-accelerated rendering. What is OpenGL used for? Creating 3D moving images in order to make virtual environments, games, movies, etc. How many commands are there in OpenGL? About 150 distinct commands that you use to specify the objects and operations needed to produce interactive 3D applications. Why are there no commands for performing Windowing Tasks or obtaining user input included in OpenGL? Because OpenGL is designed as a streamlined, hardware-independent interface to be implemented on many different hardware platforms. What are Geometric Primitives in OpenGL? Points, Lines, and Polygons

The Determinant of any orthogonal matrix is...?

The Determinant of any orthogonal matrix is...? Either +1 or -1

What is an Orthogonal Matrix?

What is an Orthogonal Matrix? Ex: The Identity Matrix, where each of its columns considered as a Vector has length 1 and the columns are orthogonal to one another. The same is true of the rows.

What is the Outer Product between two Vectors?

What is the Outer Product between two Vectors? Matrix multiplication with a column vector on the left and a row vector on the right. ab^T The result is a matrix consisting of products of all pairs of an entry of a with an entry of b. So a 3x1 matrix and a 1x3 matrix become a 3x3 matrix.

To rotate a 2D Vector by 90 degrees about the origin, you would use...?

To rotate a 2D Vector by 90 degrees about the origin, you would use...? The product of a 2x2 matrix and a column vector. [ 0 -1 ] [x] = [-y] [ 1 0 ] [y] [ x] Note: you can get the same result by using the transpose of the matrix and multiplying on the left ("premultiplying") with a row vector.

The determinant of a square matrix is simply...?

The determinant of a square matrix is simply...? The determinant of the columns of the matrix, considered as a set of vectors. |AB| = ? |A-¹| = ? |A^T| = ? |A| |B| 1/|A| |A|

The transpose of a product of two matrices is ...?

The transpose of a product of two matrices is ...? The product of the Transposes of the Matrices. (AB)^T = B^T A^T

The inverse of a product of 2 matrices is...?

The inverse of a product of 2 matrices is...? The Product of their inverses, but with the order reversed. (AB)-¹ = (B-¹ A-¹)

A Matrix multiplied by its Inverse is....?

A Matrix multiplied by its Inverse is....? I the Identity Matrix.

The Inverse of a real number x is .... and the product of x and its Inverse is...?

The Inverse of a real number x is .... and the product of x and its Inverse is...? 1/x 1

Matrix Multiplication is not Commutative in most instances, but it is....?

Matrix Multiplication is not Commutative in most instances, but it is....? Associative and Distributive (AB)C = A(BC) A(B + C) = AB + AC (A + B)C = AC + BC

Taking a product of two Matrices is only possible if...?

Taking a product of two Matrices is only possible if...? The number of columns in the first Matrix is the same as the number of rows of the right Matrix.

Matrices added together results in...?

Matrices added together results in...? Each element of one matrix added to its respective place in the other matrix.

A Matrix times a constant (scalar) results in...?

A Matrix times a constant (scalar) results in...? A Matrix where each element has been multiplied by that constant.

If we want to express a Vector c as a combination of vectors a and b, it would be ...?

If we want to express a Vector c as a combination of vectors a and b, it would be ...? c = a_ca + b_cb.

Determinants arise naturally when computing ...?

Determinants arise naturally when computing ...? The expression for one Vector as a Linear Combination of 2 other Vectors.

For any Vector v, the Dot Product of |vv| = ?

For any Vector v, the Dot Product of |vv| = ? 0. Because the Dot Product of ANY 2 vectors that are collinear, such as v with itself, is automatically 0.

For three 3D Vectors, a, b, and c, the determinant |abc| is also...?

For three 3D Vectors, a, b, and c, the determinant |abc| is also...? The signed volume of the parallelepiped formed by the three Vectors.

For 2D Vectors a and b, the determinant *|ab| is also...?

For 2D Vectors a and b, the determinant *|ab| is also...? The area of the parallelogram formed by a and b. Note: This is a signed area, and the sign is positive if a and b are right-handed and negative if they are left-handed. This means that: |ab| = -|ba|

A Vector can be represented in a different Basis via ...?

A Vector can be represented in a different Basis via ...? Multiplications with a Square Matrix.

Perhaps the most useful tool of graphics programs are...?

Perhaps the most useful tool of graphics programs are...? The Matrices that change or transform Points and Vectors.

How do you adjust the keyframes in the Animation window?

How do you adjust the keyframes in the Animation window? 1. Click on Add Property. 2. Choose which Component of the GameObject you wish to Animate. 3. Once selected, use the keyframes to adjust where on the timeline you want to place them. Alternatively, use the Top keyframe to move all of the keyframes at once.

What is a Cycle in Animation?

What is a Cycle in Animation? An animation clip that will fit seamlessly together, so that if you play it over and over again, it appears to be one long animation sequence. Therefore, we need the starting frame to be exactly the same as the last frame.

How do you start to build an Animation?

How do you start to build an Animation? 1. Open the Animation Window (not the Animator). 2. Select the Object you want to Animate. 3. Click on Create in the Animation Window.

How does Tweening work?

How does Tweening work? The software takes the values of the properties at each keyframe and calculates what the values should be for each frame in between based on how many frames there are.

What is tweening, AKA inbetweening?

What is tweening, AKA inbetweening? Once keyframes are set, an animation is already calculated between them in a process called tweening.

How do we create a new material for a GameObject that you want to be Bouncy or have a large amount of friction?

How do we create a new material for a GameObject that you want to be Bouncy or have a large amount of friction? Right click in Project, select create Physics Material. Then adjust the Bounce and Friction levels. Apply the material to the object.

A triangle with a clockwise vertex order will have a Normal Vector that points...?

A triangle with a clockwise vertex order will have a Normal Vector that points...? In the opposite direction to the Normal Vector of a triangle in the same plane with a counterclockwise vertex order.

The area of a triangle in 3D can be found by...?

The area of a triangle in 3D can be found by...? Taking the Length of the Cross Product: area = 1/2 ||(b − a) × (c − a)||

What is the Normal Vector of a triangle?

What is the Normal Vector of a triangle? It is the Vector perpendicular to ALL Vectors in the plane of the triangle, and thus it is perpendicular to the edges of the triangle.

The normal vector to a triangle can be found by...?

The normal vector to a triangle can be found by...? Taking the Cross Product of any two vectors in the plane of the triangle. It is easiest to use 2 of the 3 edges.

Given a point p, how do we compute its barycentric coordinates?

Given a point p, how do we compute its barycentric coordinates? We write p = a+ β(b−a)+γ(c−a) as a linear system with unknowns β and γ, solve, and set α = 1 − β − γ

A particularly nice feature of barycentric coordinates is that a point p is inside the triangle formed by a, b, and c if and only if

A particularly nice feature of barycentric coordinates is that a point p is inside the triangle formed by a, b, and c if and only if 0 < α < 1, 0 < β < 1, 0 < γ < 1.

p = a + β(b − a) + γ(c − a) refers to what?

p = a + β(b − a) + γ(c − a) refers to what? In a Barycentric Coordinate System, p is any point on the plane. (β,γ) represents its coordinates, because a is the "origin" b-a is an axis/vector, and c-a is the other. Note that we can reorder the terms in p = a + β(b − a) + γ(c − a) to get p = (1 − β − γ)a + βb+ γc Often people define a new variable α to improve the symmetry of the equations: α ≡ 1 − β −γ which yields the equation: p(α, β, γ) = αa+ βb+ γc, with the constraint that α + β + γ =1

What are Barycentric Coordinates?

What are Barycentric Coordinates? A non-orthogonal coordinate system. It looks like a slanted Cartesian Coordinate system. A 2D triangle with vertices a, b, c can be used to set up a non-orthogonal coordinate system with origin a and basis vectors (b - a) and (c - a). A point is then represented by an ordered pair (β,γ).

The coordinate system that makes interpolation straightforward is called...?

The coordinate system that makes interpolation straightforward is called...? Answer: Barycentric Coordinates

Often, information such as color is tagged onto .... and this information is ... across the triangle.

Often, information such as color is tagged onto .... and this information is ... across the triangle. Triangle Vertices Interpolated

What is the fundamental modeling primitive in many graphics programs?

What is the fundamental modeling primitive in many graphics programs? Answer: Triangles

What is Linear Interpolation, AKA Lerp?

What is Linear Interpolation, AKA Lerp? For a set of discrete values, Linear Interpolation can approximate other values inbetween, assuming a linear development between these discrete values. An interpolated value, calculated with linear interpolation, is calculated only in respect to the two surrounding values. To calculate a value between two other values, using linear interpolation, a certain factor, often called "step", must be used. The value has to be between value 1 (v0) and value 2 (v1). If "step" is 0.0 the interpolated value is equal to v0 and if step is 1.0, it's equal to v1. So the formula is as follows: v0 ∗ (1.0−step) + v1 ∗ step or (computationally a more efficient way): v0 + (v1 − v0) ∗ step

The most common mathematical operation in graphics is...?

The most common mathematical operation in graphics is...? Linear Interpolation

The gradient symbol is usually...? An upside-down delta, called "del" (this makes sense since delta indicates change in one variable, and the gradient is the change in for all variables).

The gradient symbol is usually...? An upside-down delta, called "del" (this makes sense since delta indicates change in one variable, and the gradient is the change in for all variables).

The Gradient at any location points to....?

The Gradient at any location points to....? The direction of the Greatest Increase of a function. Remember that the gradient does not give us the coordinates of where to go; it gives us the direction to move to increase

What is a Gradient?

What is a Gradient? The Gradient is a fancy word for derivative, or the rate of change of a function. It's a vector (a direction to move) that: 1. Points in the direction of greatest increase of a function 2. Is zero at a local maximum or local minimum (because there is no single direction of increase) The term "gradient" is typically used for functions with several inputs and a single output (a scalar field). Yes, you can say a line has a gradient (its slope), but using "gradient" for single-variable functions is unnecessarily confusing.

How do we find the Gradient Vector?

How do we find the Gradient Vector? Delta f(x, y) = (df/dx, df/dy) The Gradient Vector evaluated at a point on the implicit curve f(x, y) = 0 is perpendicular to...? The Tangent Vector of the curve at that point. This vector is also called the Normal Vector to the curve. In addition, since the gradient points uphill, it indicates the direction of the f(x, y) > 0 region.

What is the Gradient Vector?

What is the Gradient Vector? If we think of the function f(x, y) as a "height field" with height = f(x, y), the Gradient Vector points in the direction of maximum upslope, i.e., straight uphill. The gradient is a fancy word for derivative, or the rate of change of a function. It's a vector (a direction to move) that: 1. Points in the direction of greatest increase of a function (intuition on why) 2. Is zero at a local maximum or local minimum (because there is no single direction of increase) The term "gradient" is typically used for functions with several inputs and a single output (a scalar field). Yes, you can say a line has a gradient (its slope), but using "gradient" for single-variable functions is unnecessarily confusing.

An Implicit Equation in 2 dimensions has the form...?

An Implicit Equation in 2 dimensions has the form...? Answer: f(x, y) = 0 It returns a real value. Points (x, y) where this value is zero are on the curve, and points where the value is a non-zero are NOT on the curve. Thus, the points on the curve are not generated by the equation explicitly, but they are buried somewhere implicitly in the equation.

What is an Implicit Equation?

What is an Implicit Equation? An equation such as f(x, y), whose points on the curve can not be calculated immediately from the equation, and instead must be determined by solving the equation. Thus, the points on the curve are not generated by the equation explicitly, but they are buried somewhere implicitly in the equation. So if it were a function in a program, an Implicit Function would have its inner workings hidden. The only way to get an answer is to put arguments in to get results.

How do we construct an Orthonormal Basis from a Single Vector a?

How do we construct an Orthonormal Basis from a Single Vector a? By using Cross Product, we can find a new basis denoted as u, v, and w. 1. Make w a unit vector in the direction of a: w = a / ||a|| 2. Then choose any vector t not collinear with w, and use the Cross Product to build a unit vector u that is perpendicular to w: u = t x w / ||t x w|| If t is collinear with w then the denominator will vanish. A simple procedure to find a vector sufficiently different from w is to start with a t equal to w and change the smallest magnitude component of t to 1. 3. v = w x u

What is a Frame of Reference, AKA Coordinate Frame?

What is a Frame of Reference, AKA Coordinate Frame? If we want to use a coordinate system besides the Global Coordinate System, we can make an origin at some point P and orthonormal basis vectors u, v, w and then store them explicitly. a system for specifying the precise location of objects in space and time. For example, in a Flight Simulator, we might want to maintain a coordinate system with the origin at the nose of the plane, and the orthonormal basis aligned with the plane.

In 3D, three Vectors u, v, and w form an Orthonormal Basis if...?

In 3D, three Vectors u, v, and w form an Orthonormal Basis if...? They are Orthogonal (at right angles) They are each of unit length. So ||u|| = ||v|| = ||w|| = 1 and u · v = v · w = w · u = 0 The Orthonormal Basis is Right Handed provided: w = u x v otherwise it is left-handed.

Any set of 2 Vectors u and v form an Orthonormal Basis provided that...?

Any set of 2 Vectors u and v form an Orthonormal Basis provided that...? They are Orthogonal (at right angles) They are each of unit length. So ||u|| = ||v|| = 1 and u · v = 0

The Right Hand Coordinate System states that...?

The Right Hand Coordinate System states that...? When taking the Cross Product of 2 vectors, such as x x y, the resulting Vector z will extend in a certain direction. If we imagine the vectors to be the usual x, y on a sheet of paper, then z will extend "outwards from the paper" If x x y = +z, then y x x = ? -z If y x z = +x, then z x y = ? -x

A vector cross product with itself: a x a is ...?

A vector cross product with itself: a x a is ...? The Zero Vector a x a = 0

The Length of the Cross Product is also .... and is found by using ...?

The Length of the Cross Product is also .... and is found by using ...? Answer: equal to the area of the parallelogram formed from the 2 argument vectors. ||a x b|| = ||a|| ||b|| sin φ

The Cross Product a x b is usually used only for...?

The Cross Product a x b is usually used only for...? Answer: 3D Vectors

The Cross Product returns ...?

The Cross Product returns ...? Answer: A 3D Vector that is Perpendicular to the 2 argument vectors.

Besides using the equation, we can also solve the Dot Product by ...?

Besides using the equation, we can also solve the Dot Product by ...? a · b = ax × bx + ay × by In other words, by multiplying the x values together, multiplying the y values together, and then adding them.

How does the Dot Product obey the Associative and Distributive Properties?

How does the Dot Product obey the Associative and Distributive Properties? a · b = b · a *a · (b + c) = a · b + a · c (ka) · b = a · (kb) = ka · b

The Dot Product can be used to find the .... of one vector onto another.

The Dot Product can be used to find the .... of one vector onto another. Answer: Projection - The length a→b of a vector a that is projected at right angles onto a vector b. a→b = ||a|| cos φ = a · b / ||b||

The most common use of the Dot Product in graphics programs is to ...?

The most common use of the Dot Product in graphics programs is to ...? Answer: Compute the Cosine of the angle between 2 Vectors.

The Dot Product returns a value related to its arguments' ...?

The Dot Product returns a value related to its arguments' ...? Lengths and the angle φ between them: a · b = ||a|| ||b|| cos φ

The Dot Product is also known as...?

The Dot Product is also known as...? The Scalar Product, because it returns a Scalar (number) NOT a Vector.

The simplest way to multiply 2 vectors is with the...?

The simplest way to multiply 2 vectors is with the...? Dot Product denoted with a dot as: a · b

We can represent 3D, 4D, etc vectors in Cartesian coordinates. For the 3D case, we use...?

We can represent 3D, 4D, etc vectors in Cartesian coordinates. For the 3D case, we use...? A Basis Vector z that is Orthogonal to both x and y.

By convention, we write the coordinates of a as ...?

By convention, we write the coordinates of a as ...? 1. An ordered pair (x_a, y_a) 2. A Column Matrix: [x_a] [y_a] 3. and occasionally as a Row Matrix, denoted as: a^T = [x_a, y_a]

Using Cartesian systems, it is simple to compute ..., ..., and ...?

Using Cartesian systems, it is simple to compute ..., ..., and ...? Dot Products Cross Products Coordinates of Vectors

If we have 2 Orthonormal Vectors x and y, we can use them to represent...?

If we have 2 Orthonormal Vectors x and y, we can use them to represent...? All other Vectors in a Cartesian coordinate system, where each vector is represented as 2 real numbers. Ex: a = x_ax + y_ay where x_a and y_a are the real Cartesian coordinates of the 2D vector a. There are several advantages to a Cartesian coordinate system. For instance, by the Pythagorean Theorem, the length of a is: ||a|| = √xa² + ya²

If vectors are orthogonal and unit vectors, they are...?

If vectors are orthogonal and unit vectors, they are...? Answer: Orthonormal

Vectors are orthogonal if....?

Vectors are orthogonal if....? Answer: They are at right angles to each other.

Bases are especially useful if they are...?

Bases are especially useful if they are...? Answer: Orthogonal. Even more so if they are Orthonormal.

How can a vector c be expressed as a combination of two basis vectors a and b ...?

How can a vector c be expressed as a combination of two basis vectors a and b ...? Answer: c = a_c a + b_c b Note that the weights a_c and b_c are unique

Two linearly independent vectors form a ... and the vectors are thus referred to as ...?

Two linearly independent vectors form a ... and the vectors are thus referred to as ...? 2D Basis Basis Vectors

How do we scale a Vector?

How do we scale a Vector? By multiplying it by a real number k. This just multiplies the vector's length without changing its direction.

What is the Unary Minus for a Vector a?

What is the Unary Minus for a Vector a? -a. -a is a vector with the same length as a but in the opposite direction. This allows us to define subtraction for vectors: b - a = -a + b

The Net Displacement of 2 vectors is just the...?

The Net Displacement of 2 vectors is just the...? Answer: Diagonal of the parallelogram formed from the 2 Vectors.

Is vector addition commutative?

Is vector addition commutative? Answer: Yes. a + b = b + a

Two Vectors are added according to the...?

Two Vectors are added according to the...? Parallelogram Rule - The sum of 2 Vectors is found by placing the tail of either vector against the head of the other. The sum vector is the vector that "completes the triangle." The Parallelogram is formed by taking the sum in either order.

Vectors can be used to store...?

Vectors can be used to store...? 1. Offsets, also called Displacements. Ex: If we know the treasure is buried 2 paces east and 3 paces north of the secret hiding spot, we know the Offset, but not where to start. 2. Locations AKA Position AKA Point. P Locations can also be represented as a displacement from another location. Usually, there is some understood Origin location from which all other locations are stored as offsets. Note that locations are NOT Vectors.

The direction of the zero vector is...?

The direction of the zero vector is...? Answer: Undefined.

As much as possible, you should think of a Vector as an...? Arrow and NOT as coordinates or numbers.

As much as possible, you should think of a Vector as an...? Arrow and NOT as coordinates or numbers.

How do you compute the area of an arbitrary triangle using its side lengths?

How do you compute the area of an arbitrary triangle using its side lengths? 1/2 * √(a+b+c) (-a+b+c) (a-b+c) (a+b-c)

What are Polar Coordinates?

What are Polar Coordinates? Graphing system where a point P is coded as a distance from the origin, and a signed angle relative to the positive x-axis. Note that the angles are in the range (-π, π] and that the positive angles are counterclockwise from the positive x-axis.

How do we convert degrees to radians?

How do we convert degrees to radians? π/180 x degrees

How do we convert radians to degrees?

How do we convert radians to degrees? 180/π x radians

The units used to measure Arc Lengths are...?

The units used to measure Arc Lengths are...? Radians

In Computer Graphics, an angle is defined by...?

In Computer Graphics, an angle is defined by...? The Length of the Arc Segment it cuts out on the Unit Circle.

What is the discriminant of a Quadratic Equation?

What is the discriminant of a Quadratic Equation? The term that determines the number of real solutions. D = B² - 4AC If D > 0, there are 2 real solutions. If D = 0, there is 1 real solution. ( a "double root") If D < 0, there are NO real solutions.

How do we solve a Quadratic Equation?

How do we solve a Quadratic Equation? -B ± √(B² - 4AC) ----------------- 2A

What is the form of a Quadratic Equation?

What is the form of a Quadratic Equation? Ax² + Bx + C = 0 where x is a real unknown, and A, B, and C are known constants.

What is the natural logarithm?

What is the natural logarithm? The logarithm with base e. Also denoted as: ln x = log_e x

When we apply calculus to logarithms, what number often turns up?

When we apply calculus to logarithms, what number often turns up? e, the special number = 2.718...

What are the 3 Set Operations? (When used with intervals)

What are the 3 Set Operations? (When used with intervals) 1. Intersection - The set of points two intervals have in common. 2. Union - Points in either interval. 3. Difference - Depends on argument order. Returns the points in the left interval that are not also in the right.

How would we indicate that a point x is in the unit cube?

How would we indicate that a point x is in the unit cube? Answer: x ∈ [0, 1]³*

What is the inverse function of f(x) = x³?

What is the inverse function of f(x) = x³? Answer: f^-1(x) = ∛x

What is a bijection?

What is a bijection? Maps every a ∈ A to a unique b ∈ B and for every b ∈ B, there is exactly one a ∈ A such that f(a) = b. Functions that are NOT bijections have NO Inverse.

What is an Inverse Function?

What is an Inverse Function? If we have a function f : A ↦ B, there may exist an Inverse Function: f^-1 : B ↦ A which is defined by the rule f^-1 (b) = a where b = f(a). This definition only works if every b ∈ B is an image of some point under f (that is, the range equals the target) and if there is only one such point (that is, there is only one a for which f(a) = b)

Notation for mappings uses the ...?

Notation for mappings uses the ...? f : ℝ ↦ ℤ which you can read as "There is a function called f that takes a real number as input and maps it to an integer." Here, the set that comes before the arrow is called the domain of the function, and the set after the arrow is called the target. In programming, you can read it as "There is a function called f which has one real argument and returns an integer." In other words, the set notation above is equivalent to the common programming notation: integer f (real) ← equivalent → f : ℝ ↦ ℤ So the colon-arrow notation can be thought of as a programming syntax.

What does S² represent?

What does S² represent? The set of 3D points (points in R³) on the unit sphere. Note that although S² is composed of points embedded in 3D space, they are on a surface that can be parameterized with 2 variables, so it can be thought of as a 2D set.

What does ℝ² represent?

What does ℝ² represent? Answer: The ordered pairs in the real 2D plane.

What does A² represent?

What does A² represent? Answer: The set A x A

What is the Cartesian Product of 2 sets A x B?

What is the Cartesian Product of 2 sets A x B? The set created by the Cartesian Product AxB is composed of all possible ordered pairs (a, b) where a ∈ A and b ∈ B. We can extend the Cartesian Product to create a set of all possible ordered triples from three sets, and so on for arbitrarily long ordered tuples from arbitrarily many sets.

Given any 2 sets A and B, we can create a 3rd set by taking the ___ ___ of the 2 sets, denoted AxB.

Given any 2 sets A and B, we can create a 3rd set by taking the ___ ___ of the 2 sets, denoted AxB. Answer: Cartesian Product

What are mappings?

What are mappings? AKA Functions Like a function in a program, a Mapping in math takes an argument of one type and maps it to (returns) an object of a particular type. In programming, we say "type", but in math we identify the "Set." When we have an object that is a member of a set, we use the ∈ symbol.

What are the suggested strategies for debugging a graphics program's code?

What are the suggested strategies for debugging a graphics program's code? 1. Scientific Method - Create an image using the program and observe what is wrong with it. Then form a hypothesis about the cause and test it. 2. Images as Coded Debugging Output - Use the output image. If you want to know the value of some variable for part of a computation that runs for every pixel, you can just modify your program to copy that value directly to the output image and skip the rest of the calculations that would normally be done. 3. Using a Debugger - Set a "Trap" for the bug. First make sure your program is deterministic-run it in a single thread and make sure that all random numbers are computed from fixed seeds. Then find out which pixel or triangle is exhibiting the bug and add a statement before the code you suspect is incorrect that will be executed only for the suspect case. If you set a break point on the print statement, you can drop into the debugger just before...

Modern architecture suggests that ___ and ___ are the keys to efficiency.

Modern architecture suggests that ___ and ___ are the keys to efficiency. Keeping memory use down Maintaining coherent memory access

What are the basic classes that need to be written for a graphics program?

What are the basic classes that need to be written for a graphics program? 1. Vector2 2. Vector 3 3. hVector 4. RGB 5. Transform 6. Image Maybe's: Intervals Orthonormal Bases Coordinate Frames

Why is it that the current heuristic for code efficiency is paying more attention to memory access patterns than to operations counts, when the opposite was true two decades ago?

Why is it that the current heuristic for code efficiency is paying more attention to memory access patterns than to operations counts, when the opposite was true two decades ago? Because the speed of memory has not kept pace with the speed of processors. Since this trend will continue, the importance of limited and coherent memory access for optimization should only increase.

Perhaps the most useful aspect of IEEE floating-point is how divide-by-zero is handled; for any positive real number a, what are the 2 rules involving division by 0?

Perhaps the most useful aspect of IEEE floating-point is how divide-by-zero is handled; for any positive real number a, what are the 2 rules involving division by 0? 1. +a / +0 = +∞ 2. -a / +0 = -∞ a = f(x) if(a > 0) { do something } What does the if-statement evaluate to when: a = +∞? a = -∞? a = NaN? +∞ > 0 = true -∞ > 0 = false NaN > 0 = false

The 3 rules in a Boolean expression involving infinite vales are...?

The 3 rules in a Boolean expression involving infinite vales are...? 1. All finite valid numbers are less than +∞. 2. All finite valid numbers are greater than -∞. 3. -∞ is less than +∞. The 2 rules involving expressions that have NaN values are...? 1. Any arithmetic expression that includes NaN results in NaN. 2. Any Boolean expression involving NaN is FALSE.

What are the rules for dividing a positive number a by an infinite amount?

What are the rules for dividing a positive number a by an infinite amount? 1. +a / +∞ = +0 2. -a / +∞ = -0 3. +a / -∞ = -0 4. -a / -∞ = +0 In short, any number divided by infinity = 0.

What are the 3 special values for real numbers in the IEEE floating point standard?

What are the 3 special values for real numbers in the IEEE floating point standard? 1. Infinity - This is a valid number that is larger than all other numbers. 2. Minus Infinity - This is a valid number that is smaller than all other valid numbers. 3. Not a Number "NaN" - This is an INvalid number that arises from an operation with undefined consequences, such as zero divided by zero. What are the two representations for zero in the IEEE floating-point standard? +0, treated as a positive, and -0, treated as a negative. The distinction between +0 and -0 only matters occasionally, but it is worth keeping in mind.

What is Array Slicing?

What is Array Slicing? Answer: Taking a subset from an array and allocating a new array with those elements. Takes O(n) time and O(n) space, where n is the number of elements in the resulting array. var slice = new int[endIndex - startIndex]; Array.Copy(sourceArray, startIndex, slice, 0, slice.Length);

The main thing we use logarithms for is what?

The main thing we use logarithms for is what? Answer: Solving for x when x is an exponent.

A Logarithm is really asking what?

A Logarithm is really asking what? Answer: "What power must we raise the base to, in order to get this answer?"

For C# variables allocated to the heap, when is allocation handled?

For C# variables allocated to the heap, when is allocation handled? Answer: At Run Time

For C# variables allocated to the stack, when is allocation handled?

For C# variables allocated to the stack, when is allocation handled? Answer: At Compile Time

Unlike the Stack, variables created on the heap are...?

Unlike the Stack, variables created on the heap are...? Answer: Accessible by any function, anywhere in your program. Heap variables are essentially global in scope.

Why is Heap memory slightly slower to read from and write to, compared to stack memory?

Why is Heap memory slightly slower to read from and write to, compared to stack memory? Answer: Because you have to use Pointers to access memory on the Heap.

Unlike the Stack, the Heap does not have size restrictions on what?

Unlike the Stack, the Heap does not have size restrictions on what? Answer: Variable size (apart from the obvious physical limitations of your computer.)

What is the Heap memory?

What is the Heap memory? A region of your computer's memory that is NOT automatically managed for you, and is not as tightly managed by the CPU. It is a more free-floating region of memory (and larger). To allocate memory on the Heap (in C), you must use function calls such as malloc( ) or calloc( ), which are built-in C functions. Once you have allocated memory on the heap, you are responsible for using free( ) to deallocate that memory once you don't need it anymore. If you fail to do this, your program will have a memory leak, which means memory will still be set aside and unavailable for your other processes.

Why do variables called in functions have limited scope and referred to as "local variables"?

Why do variables called in functions have limited scope and referred to as "local variables"? These variables are pushed onto the stack when they are created and popped off the stack when the function exits/completes.

What is the advantage of using Stack to store variables?

What is the advantage of using Stack to store variables? Memory is managed for you. You don't have to allocate memory by hand, or free it once you don't need it anymore. What's more, because the CPU organizes stack memory so efficiently, reading from and writing to stack variables is very fast.

What is the Stack?

What is the Stack? A special region of your computer's memory that store temporary variables created by each function (including Main( ) ). It is managed and optimized by the CPU quite closely. Everytime a function declares a new variable, it is pushed where? Everytime that function exits, what happens to all of the variables? Onto the Stack. They are freed / deleted. Once a stack variable is freed, that region of memory becomes available for other stack variables.

What are the steps to answering an interview problem? 1. Make sure you understand. 2. ASK clarifying questions. (They WANT you to do this.) 3. Talk out your thought process to the interviewer.

What are the steps to answering an interview problem? 1. Make sure you understand. 2. ASK clarifying questions. (They WANT you to do this.) 3. Talk out your thought process to the interviewer.

What are some ways to approach designing an algorithm for a new problem?

What are some ways to approach designing an algorithm for a new problem? 1. Frame your problem in terms of another, more general problem to use an already existing algorithm. 2. Start with a Brute Force application to give yourself a base. Then optimize it. 3. Divide and Conquer - a way of dealing with a large problem by breaking it down into bits and pieces and working your way up towards the solution. Instead of seeing the whole problem as a single, huge and complex task you divide the problem in relatively smaller problems that are easier to understand and deal with. You solve smaller problems and aggregate the solution until you are left with the solution only. At each step the problem at hand shrinks and the solution gets mature until you have the final correct solution. Solving the smaller task and applying the same solution repetitively ( or often times recursively) to other chunks give you the result in less time.

How do we use XOR to cancel out matching numbers?

How do we use XOR to cancel out matching numbers? Start with 0, and XOR every number you come across. If there are multiple pairs and only one unique number, the remaining number will be the unique number.

How do we know when to use bit manipulation to solve a problem?

How do we know when to use bit manipulation to solve a problem? 2 things to watch out for: 1. We want to multiply or divide by 2 (use a left shift to multiply by 2, right shift to divide by 2) 2. We want to cancel out matching numbers. (Using XOR)

How do we reduce the likelihood of Integer Overflow in C#?

How do we reduce the likelihood of Integer Overflow in C#? Use larger integer types, such as long. There are also libraries built to handle arbitrarily large numbers. C# also has a checked keyword, which enables runtime overflow detection.

How does C# handle Integer Overflow?

How does C# handle Integer Overflow? The processor will sort of "do its best" with the bits it has, taking the true result and throwing out any bits that don't fit. So in our example above, when adding 01 to 11, the processor would take the true result 100 and throw out the highest bit, leaving 00.

What is Integer Overflow?

What is Integer Overflow? Sometimes we have a number that does fit in 32 or 64 bits, but if we add to it (or multiply it by something, or do another operation) the result might not fit in the original 32 or 64 bits. This is Integer Overflow.

When you create an integer variable, what does your computer actually do?

When you create an integer variable, what does your computer actually do? The computer allocates a fixed number of bits for storing it. Most modern computers use 32 or 64 bits, but some numbers are so big they don't fit even in 64 bits, like sextillion, which requires 70 digits in binary.

If a number is encoded using Two's Complement, then an Arithmetic Right Shift ___ the number's sign, while a Logical Right Shift makes the number ___.

If a number is encoded using Two's Complement, then an Arithmetic Right Shift ___ the number's sign, while a Logical Right Shift makes the number ___. Preserves Positive

In C#, a Right Shift Operator automatically does ___ on signed types, but ___ on unsigned types.

In C#, a Right Shift Operator automatically does ___ on signed types, but ___ on unsigned types. Arithmetic Right Shift (copies the most significant bit) Logical Right Shift (The reverse of a Left Shift. Moves everything 1 space to the right and adds a 0 as the leftmost bit.)

What is an Arithmetic Right Shift?

What is an Arithmetic Right Shift? With an Arithmetic Right Shift, the Least Significant Bit is lost, and the Most Significant Bit is COPIED and placed in the leftmost spot. // -5 Arithmetically Right Shifted = -3 1011 >> 1 -> 1101 // -5 Arithmetically Right Shifted 3 times = 1011 >> 3 -> 1111 = -1

For positive numbers, a single Logical Right Shift does what to a number?

For positive numbers, a single Logical Right Shift does what to a number? Divides a number by 2, throwing out any remainders. 0101 >> 1 -> 0010 = 2

What is a Logical Right Shift?

What is a Logical Right Shift? When shifting right with a Logical Right Shift, the least-significant bit is lost and a 0 is inserted on the other end. // -5 with a logical right shift = 5 1011 >> 1 -> 0101 = 5 // -5 with 3 logical right shifts = 1 1011 >> 3 -> 0001 = 1

What is a Left Shift?

What is a Left Shift? When shifting left, the most significant bit is lost, and a 0 bit is inserted on the other end. The left shift operator is usually written as "<<". A single left shift multiplies a binary number by 2. // 2 bit shifted left by 1 space = 4 0010 << 1 -> 0100 = 4 // 2 bit shifted left by 2 spaces = 8 0010 << 2 -> 1000 = 8

What is a Bit Shift?

What is a Bit Shift? Bit Shift moves each digit in a number's binary representation left or right. There are 3 main types of shifts: 1. Left Shift 2. Logical Right Shift 3. Arithmetic Right Shift

What bitwise operation can make positive numbers negative, and vice versa?

What bitwise operation can make positive numbers negative, and vice versa? ~ the NOT operator. ~5 -> -6 0101 -> 1010 = -8 + 2 This is the same when you involve multiple zeroes, because the leftmost Bit will be a negative number. 0000 0101 -> 1111 1010 = -128 + 64 + 32 + 16 + 8 + 2 = -128 + 122 = -6

What does the bitwise NOT operator do?

What does the bitwise NOT operator do? The NOT operation INVERTS BITS. A 0 becomes a 1. A 1 becomes a 0. It is written as the tilde character ~ which goes before the 2 numbers. ~ 0000 0101 -> 1111 1010

When performing the XOR operation on two integers, how is it calculated?

When performing the XOR operation on two integers, how is it calculated? The Exclusive OR operation is calculated on each pair of bits (the two bits at the same index in each number.) 5 ^ 6 -> 3 0101 ^ 0110 -> 0011

What does the bitwise XOR operation do?

What does the bitwise XOR operation do? The Exclusive OR operation takes two bits and returns 1 if EXACTLY ONE bit is 1. Otherwise it returns 0. 1 ^ 1 -> 0 1 ^ 0 -> 1 0 ^ 1 -> 1 0 ^ 0 -> 0

When performing the OR operation on two integers, how is it calculated?

When performing the OR operation on two integers, how is it calculated? The OR operation is calculated on each pair of bits (the two bits at the same index in each number.) 5 | 6 -> 7 0101 | 0110 -> 0111

What does the bitwise OR operation do?

What does the bitwise OR operation do? Takes two bits and returns 1 if EITHER of the bits are 1. Otherwise it returns a 0. 1 | 1 -> 1 1 | 0 -> 1 0 | 1 -> 1 0 | 0 -> 0

When performing the AND operation on two integers, how is it calculated?

When performing the AND operation on two integers, how is it calculated? The AND operation is calculated on each pairs of bits (the two bits at the same index in each number) 5 & 6 would return 4, because 5 = 101 and 6 = 110, so it returns the 4 because that is the index that is a 1 in both.

What does the bitwise AND operation do?

What does the bitwise AND operation do? Takes two bits and returns 1 if BOTH bits are 1. Otherwise, it returns 0. 1 & 1 -> 1 1 & 0 -> 0 0 & 1 -> 0 0 & 0 -> 0

If an interviewer asks you to convert base-2 into decimal, what should you ask?

If an interviewer asks you to convert base-2 into decimal, what should you ask? "Is that in two's complement or not?"

___ numbers are represented in two's complement, and ___ numbers use base 2.

___ numbers are represented in two's complement, and ___ numbers use base 2. Signed Unsigned

What is Two's Complement Notation?

What is Two's Complement Notation? The leftmost digit is negative, and the rest of the digits are positive. So while normally, 101 = 5, in Two's Complement, it would be: -4 + 0 + 1 = -3

Negative numbers are typically represented in binary using what?

Negative numbers are typically represented in binary using what? Answer: Two's Complement Encoding