Sunday, August 2, 2009

Two math questions?

Q1. A cubical box is to be built so that it holds 125 cubic centimetres. How precisely should the edge be made so that the volume will be correct to within 3 centimetres? (I am pretty sure this has something to do with differentials but still not able to figure out the answer).





Q2. Let A, B and C be the points with coordinates (2,1,1) (0,4,1) and (2,1,4) respectively. Find the equation of the plane through the three points A, B and C. (vector question although i still am not able to figure out what to do with the coordinates).

Two math questions?
Just a guess..in Calc? lol...definately a differentials problem. Assuming you're in calc 3..because you're into vectors..try Linearization if you haven't already. I'd love to help you..but it's late..and i go brain dead over summer..sorry.
Reply:plzz...dont make us confused and frightened.


Does anyone know how to find the circumcentre of a triangle using vectors?

its just for any triangle with sides are a, b, c and vertices (x1,y1), (x2,y2) and (x3,y3). are there any theorems i could look up?

Does anyone know how to find the circumcentre of a triangle using vectors?
I don't know the theorem, but the circumcentre is :


( (x1+x2+x3)/3 , (y1+y2+y3)/3 ). If you treat the vertices as a vector, then the vector for the circumcentre is


1/3* ( (x1,y1) + (x2,y2) +(x3,y3) )
Reply:I am not from an English speaking country, so it is sometimes difficult to understand the meaning of some terms.





As I understand, a circumcenter is a center of a circle which comes through the three points A(x1, y1), B(x2,y2), C(x3,y3).





The previous answer gave the center of mass of a triangle with these points as apexes, (x1 + x2 + x3)/3 and (y1 + y2 + y3)/3.





The center of a circle wich comes through the points A, B, C is equally remote from the three points. Geometrically, it is the intersection point of lines that are perpendicular and come across the middle points of sections AB, BC and/or AC.





To find it, we can write and solve two equations for the lines that come across the middles of triangle's sides and perpendicular to the sides.





So, for the AB side, the middle point is {(x1+x2)/2, (y1+y2)/2}. The coefficient k for the line y=kx + a we can find from the condition that for two perpendicular to each other lines


Y = KX + A and y = kx + a, K*k = -1, and we know the coefficient for the AB side of the triangle as (y2-y1)/(x2-x1), hence, the line is


y = - (x2-x1)/(y2-y1)x + a, and to find a we have to take


x = (x1+x2)/2, and to obtain y = (y1+y2)/2:





(y1+y2)/2 = - [(x2-x1)/(y2-y1)](x1+x2)/2 + a


a = (y1+y2)/2 + (x2-x1)(x2+x1)/[2(y2-y1)].





So, the first line is:


y(AB) = - (x2-x1)/(y2-y1) x + (y1+y2)/2 + (x2-x1)(x2+x1)/(2(y2-y1))





The second line we shall write for the perpendicular to the BC side of the triangular that comes across the middle of the BC side. Making the analogous calculations, we shall obtain


y(BC)= - (x3-x2)/(y3-y2) x + (y2+y3)/2 + (x3-x2)(x3+x2)/(2(y3-y2))





And the intersection of these two lines will give us the centre of the circle. So, we only have to find the x and y common to these two equations. We have to find x, at which y(AB) = y(BC)


- (x3-x2)/(y3-y2) x + (y2+y3)/2 + (x3-x2)(x3+x2)/(2(y3-y2)) =


= - (x2-x1)/(y2-y1) x + (y1+y2)/2 + (x2-x1)(x2+x1)/(2(y2-y1))


x[(x2-x1)/(y2-y1) - (x3-x2)/(y3-y2)] = [(y1+y2) - (y3+y2)]/2 +


(x2-x1)(x2+x1)/(2(y2-y1)) - (x3-x2)(x3+x2)/(2(y3-y2)), and





x[y3(x2-x1) +y1(x3-x2) +y2(x1-x3)]/[(y2-y1)(y3-y2)] = (y1-y3)/2 +


+ (x2-x1)(x2+x1)/2(y2-y1) - (x3-x2)(x3+x2)/2(y3-y2),


or


x = (1/2)[(y2-y1)(y3-y2)(y1-y3) + (x2-x1)(x2+x1)(y3-y2) - (x3-x2)(x3+x2)(y2-y1)]/[y3(x2-x1) + y1(x3-x2) + y2(x1-x3)] =


= X = (1/2)[(y2-y1)(y3-y2)(y1-y3) + y3(x2^2-x1^2) +y1(x3^2-x2^2) +y2(x1^2-x3^2)]/[y3(x2-x1) + y1(x3-x2) + y2(x1-x3)]





This is the x value for the centre of the circle. And we can find the y value for the centre of the circle. For example, from y(AB) = - (x2-x1)/(y2-y1) x + (y1+y2)/2 + (x2-x1)(x2+x1)/(2(y2-y1)), we shall input the value of x and obtain:


Y= - 0.5 [(x2-x1)(x1-x3)(x3-x2) - y3^2(x2-x1) - y1^2(x3-x2) - y2^2(x1 - x3)]/[y3(x2 - x1) + y1(x3 - x2) + y2(x1 - x3)] =


= (1/2)[(x2-x1)(x1-x3)(x3-x2) - y3^2(x2-x1) - y1^2(x3-x2) - y2^2(x1-x3)]/[x1(y3-y2) +x2(y1-y3) + x3(y2-y1)] =


= Y = (1/2)[(x2-x1)(x1-x3)(x3-x2) + x1(y3^2-y2^2) + x2(y1^2-y3^2) + x3(y2^2-y1^2)]/[x1(y3-y2) +x2(y1-y3) + x3(y2-y1)]


So, as we see, the formula for the centre of the circle coordinates exists, and the expression is symmetrical concerning the substitution of x to y coordinates of the points, and also symmetrical concerning the substitution of (x1,y1), (x2,y2) and (x3,y3) between each other.

send flowers

Physics (Newton's 2nd Law, Constant Acceleration, Vectors)?

A block is projected up a frictionless inclined plane with initial speed Vo = 3.42 m/s. The angle of incline is = 32.1°.





(a) How far up the plane does the block go?


_________ m


(b) How long does it take to get there?


_________ s


(c) What is its speed when it gets back to the bottom?


_________ m/s





I tried, but didn't reach the right result.

Physics (Newton's 2nd Law, Constant Acceleration, Vectors)?
Easy peasy :)





Firstly, you need to translate the vector of initial movement into its two axis, one going up and down, the same direction as gravity is going, and the other side-to-side.





This can be done using trigonometry. The speed in up/down can be determined using a triangle with hypotenuse being 3.42m/s and the incline angle of 32.1 degrees. sin(32.1) = y/3.42. Y = 1.82m/s. Then, determine the side to side componant with Pythagorean Theorem: 3.42^2 = X^2 + 1.82^2. X = 2.9m/s





Now that you have that figured out, you can determine the amount of time it takes for the object to accelerate to 0m/s (from Y=1.82m/s) using the At + Vo = V(t) formula. Given that gravity is 9.81m/s/s we have:


-9.81m/s/s * t = -1.82m/s


-9.81m/s/s * t = -1.82m/s


t = 0.185 seconds (b)





You can determine (a) by using the At^2 + Vt + Xo = X(t) formula by plugging in t = 0.185 seconds.


-9.81m/s/s * t^2 + 1.82m/s * t = X(t)


-9.81m/s/s * (0.185)^2 + 1.82m/s * 0.185 = X(t)


-0.3357m + 0.3367m = X(t) = 0.001m ( 1mm )





The speed when it comes back down can be determined by seeing how long it falls from its highest point (1mm) and then adding in a side-ways componant.


At^2 + Vt + 1mm = X(t)


At^2 + Vt = -0.001m


-9.81m/s/s * t^2 = 0.001m


t^2 = 0.0001


t = 0.01s (this means the object falls for 0.01 seconds before being at the starting position/bottom)





At = Vy... -9.81m/s/s * 0.01 = -0.1m/s





Plugging this value back into the original starting triangle, putting it at the up and down spot, we can see see that:


sin(32.1) = -0.1 / X


X = 0.188m/s (c)





Hopefully my math isnt wrong. :)


Can you help me solve this Calculus / Vectors problem...?

x/a=y/b=z/c=1. Prove.

Can you help me solve this Calculus / Vectors problem...?
x/a=y/b=z/c=1 is wrong!


the question should be:


prove


x/a + y/b + z/c = 1





PROOF:


Assume the equation of the plane is


Ax + By + Cz = D (1)


The point (a, 0, 0) is on the plane, so Aa = D, A = D/a (2)


The point (0, b, 0) is on the plane, so


Bb = D, B = D/b (3)


The point (0, 0, c) is on the plane, so


Cc = D, C = D/c (4)


Plug (2), (3), (4) into (1) and get


x/a + y/b + z/c = 1


Find the angle between the two vectors [5,2] and [-2,5]?

possible answers are


a. zero degrees


b. 30 degrees


c. 60 degrees


d. 90 degrees

Find the angle between the two vectors [5,2] and [-2,5]?
Hi,





The correct answer is D, 90°.





This angle is found from the formula:





scalar product of 2 vectors


------------------------------------- = cos θ


product of magnitudes





The scalar product of [5,2] and [-2,5] is found by





X1*X2 + Y1*Y2 = 5(-2) + 2(5) = -10 + 10 = 0





The magnitude of the 2 vectors is found by √(x² + y²) which is


..________.....________


√(5² + (-2)²) + √(-2)² + 5²





Substituting these in the formula for the angle, it becomes:





scalar product of 2 vectors


------------------------------------- = cos θ


product of magnitudes





0


--------------- = cos θ


√50 * √50





0


---- = 0 = cos θ


50





If cos θ = 0, then arc-cos(0) = 90. so θ = 90°.





I hope that helps. :-)
Reply:cos @ = (a1b1 + a2b2) / (|A||B|)


So here, that would be arccos 0 or 90 degrees.
Reply:Use dot product.


a * b = |a||b|cosx





a * b


= [5,2] * [-2,5]


= -10 + 10 = 0





cosx = (a * b) / (|a||b|)


= 0 / (|a||b|)


= 0


x = cos^-1(0)


= 90 degrees OR 0 degrees





BUT since [5,2] and [-2,5] are not scalar multiples of each other the answer is just 90 degrees so


Answer: d.
Reply:Use the dot product.





Gasp! - dont tell me that you dont know what dot product is.
Reply:cosθ = dot product/product of magnitudes





cosθ = 0/whatever


cosθ = 0


θ = 90 [d]


Determine m such that the two vectors 3i-9j and mi+2j are orthogonal?

possible answers


a. -2/3


b. -3/2


c. 4


d. 6

Determine m such that the two vectors 3i-9j and mi+2j are orthogonal?
If two vectors are orthoginal (i.e. perpendicular), their dot product is 0. This comes from the formula to find the angle formed by two vectors, which is cosθ = dot product/product of magnitudes. In order for θ=90, the cosine has to be 0, which means the dot product in that formula must be 0. Hence:


3m - 18 = 0


m = 6
Reply:Dot product must equal 0


3m - 18 = 0


m = 6


ANSWER d.
Reply:is that an error on the second vector: mi
Reply:If the vectors are orthogonal the dot product will be zero.





%26lt;3, -9%26gt; • %26lt;m, 2%26gt; = 3m - 18 = 0


3m = 18


m = 6





The answer is d.
Reply:if you have two arrays:


ai+bj and ci+dj


then the condition for them to be perpendicular is:


a*c+b*d=0


thus: 3*m+(-9)*2=0


m=6

quince

Could anyone help me with basic vectors and introductory physics topics?

I'd like to see how these problems are done step by step....


Suppose A = BC where A has the dimensions L/M and C has the dimensions L/T. Then B has the dimension: (I got b = l^2/mt) -very unsure though





A sailboat leaves a harbor and sails 1.1 km in the direction 75degrees nort of east where it stops. The boat later sails 1.8 km in the direction 15 degrees south of east. What is magnitude of resultant displacement? ( I got 2.1)

Could anyone help me with basic vectors and introductory physics topics?
The dimensional analysis seems right - not sure though.





A) x= 1.1 cos 75, y= 1.1 sin 75





B) x= 1.8 cos -15, y= 1.8 sin -15





Add x components


Add y components





Resultant = (Sqrroot( x^2 + y^2))


Angle of the difference of two vectors?

vA = (4.0m)i - (3.0m)j and vB = (6.0)i + (8.0m)j





What are (a) the magnitude and (b) the angle (relative to i) of vA? What are (c) the magnitude and (d) the angle of vB? What are (e) the magnitude and (f) the angle of vA+vB; (g) the magnitude and (h) the angle of vB-vA; and (i) the magnitude and (j) the angle of vA-vB? (State your angle as a positive number.) (k) What is the angle between the directions of vB-vA and vA-vB?

Angle of the difference of two vectors?
will do a few..a) |vA| = 5, b) angle is arctan [-3/4] + 2 pi.......


e) | vA + vB| =sqrt[125], f) angle is arctan[5/10],......k) pi since the are negatives of each other..you should be able to do these.


What is the sum of multiple vectors known as?

A. Cross Product


B. Moment


C. Resultant


D. Scalar

What is the sum of multiple vectors known as?
Its C. Resultant





cross product has something to do with multiplication .. not addition





moment is the product of the force with its perpendicular distance from origin.





resultant is the result of 2 or more vectors which is found by adding them





scalar is a non-vector number (doesnt hv direction)
Reply:it's resultant





if you want to know an easy way to figure this out in future, go to google, and type:





define:resultant





or whatever terms you have until you come up with the right one. Instead of giving you lots of extraneous data, it just gives you straight-out definitions.
Reply:it is D scalar know can you answer my question
Reply:It is the resultant





Cross product is to multiply the vectors, to find a vector that is perpendicular to the initial vectors. (You'll have to imagine your world in at least 3 dimentions then, since in 3 dimentions you only have x,y and z coordinates)





"Moment is a quantity that represents the magnitude of force applied to a rotational system at a distance from the axis of rotation." Associated with rotational kinematics.


see http://www.wikipedia.org





A scalar is a non-vectorial measurement.


What is the best definition of vectors?

a: quantities described by both speed and movement





b: quantities described by both magnitude and direction





c: quantities described by both velocity and acceleration





d: quantities described by both force and gravity

What is the best definition of vectors?
b: quantities described by both magnitude and direction





,.,.,.
Reply:b
Reply:magnitude and direction

garden centre

How to find cosine of the angle between two vectors?

b = 5i +3j, c = 2i + 4j + k, find cosine of the angle between b and c.

How to find cosine of the angle between two vectors?
A . B = |A|*|B|*cos(theta),


where theta is the angle between the vectors.


Solve this for cos(theta), plug in your vectors, do the algebra (argument of each vector and their dot product), and there's your answer.
Reply:cosine law is ABcosine%26lt;


Help with dot product and vectors!!!?

A triangle has its vertices at A(-1,3), B(3,6) and C(-4,4).


a) Show that AB dot AC = -9.


b) Show that, to three significant figures, cosBAC= -0.569

Help with dot product and vectors!!!?
You need to have three dimensional coordinates e.g. (1,3,5) to use the dot product.





In any case...





AB.AC = (a1a2) + (b1b2) + (c1c2)





and





Cosine of angle = AB.AC/ |A| |B|





That is the cosine of the angle = the dot product AB.AC divided by the magnitude of A times the magnitude of B.





Hope this helps.
Reply:a) AB and AC are vectors


AB . AC = (4 3) . ( -3 1) = - 12 + 3 = - 9





b) AB . AC = |AB| |AC|cos A


- 9 = √25 √10 cos A


cos A = - 9 / 5√10


cos A = - 0.569 as required.


I'm having trouble understanding vectors... can some one explain this?

given a = (8,6), b- (,3), c=(1,2) and d= (-3,-6)





find the magnitude of a.





determine if b and d are equal.





find the coordinates of a + b.

I'm having trouble understanding vectors... can some one explain this?
what the heack is that
Reply:maganitude of a = ( 8^2+6^2)^1/2 = (64+36)^1/2 = (100)^1/2 = 10 units


please check the coordinates of b.(_,3)


to check whether b and d are equal u have to first find their magnitude.


use the formula: (x^2+y^2)^1/2 to find magnitude. if the magnitude of b and d comes out to be same then they are equal otherwise not.


coordinate of a+b: x coordinate=(8+x coordinate of b)


y coordinate=(6+3)


The angle θ , where 0 < θ < 180o between the vectors u & w, where u= i + 2j - k, v= 3 i - j + 4k, & w= 2j - k

possible angle...





a. 24.1o





b. 57.2o





c. 79.5o





d. 100.1o





e. 103.9o





f. 113.6o





g. 121.8o





h. 132.4o





or is it none of these?

The angle θ , where 0 %26lt; θ %26lt; 180o between the vectors u %26amp; w, where u= i + 2j - k, v= 3 i - j + 4k, %26amp; w= 2j - k
cos(theta) = u.w / ( |u| |w| )


= (1,2,-1).(0,2,-1) / sqrt(6)sqrt(5)


= (0 + 4 + 1) / sqrt(30)


theta = arccos(5/sqrt(30))


= 24.1deg.
Reply:It's about 24.1 degrees.





The vector "v" is not needed, this problem is only about u %26amp; w.





dot product of u %26amp; w = [ 1*0 + 2*2 + (-1)*(-1) ] [ |u| |w| ]


= [ 0 + 4 +1 ] / [sqrt(6)* sqrt(5) ]


= 5 / [sqrt(6)* sqrt(5) ] = sqrt(0.83333...) = 0.9128709...


arccos(0.9128709...) = 24.094843... degrees

flower show

Can you prove this inequality w i t h o u t use of vectors?

this is Pedoe's inequality:


for two triangles abc and a'b'c' ,with areas F and F' respectively you have :


a^2.((b'^)2 + (c')^2 - (a')^2) + b^2.((a')^2 + (b')^2 - (c')^2) + c^2.((a')^2 + (b')^2 - (c')^2) %26gt;= 16.F.F'


equality stands for similar triangles.

Can you prove this inequality w i t h o u t use of vectors?
Let s=1/2 . (a+b+c), s'=1/2 . (a'+b'+c'),


F=sqrt[s . (s-a) . (s-b) . (s-c)],


F'=sqrt[s' . (s'-a') . (s'-b') . (s'-c')],


16.F.F' = sqrt{[(a+b)^2-c^2] . [c^2-(a-b)^2] . [(a'+b')^2-c'^2] . [c'^2-(a'-b')^2]} %26lt;=


1/2 . {[(a+b)^2-c^2] . [c'^2-(a'-b')^2] + [c^2-(a-b)^2] . [(a'+b')^2-c'^2]} = a^2.((b'^)2 + (c')^2 - (a')^2) + b^2.((a')^2 + (b')^2 - (c')^2) + c^2.((a')^2 + (b')^2 - (c')^2),


when a'/a=b'/b=c'/c, we get the equality.


C programming simple help?

Can u solve this for me


1.Write a program which will read int vector (max leinght 100) and another int.Then the programm should show how many times, the int number will appear in the vector


I need this exercise to understand the vectors cause i can't right now :(, can u plz help me and give me an explanations about the steps...


thanx a ton

C programming simple help?
I think you mean Array from vector. if that's so,





int count = 0, array[100];


int b;


int count2, countB = 0;





for ( ; count %26lt; 100, array[count] != 0 ; count++)


/* array[count] != 0, we need this for stopping condition. u can use any thing */


{


scanf("%d",array[count] );


// each time you enter a value, it will be stored in the array


}








// now take the value which u want to check appearance





scanf("%d",%26amp;b);





// now another loop to go through the array.





for ( count2 = 0; count2 %26lt; count ; count2 ++ )


/* I think u know why "count2%26lt;count". because from 100 of the array size just the amount of "count" we have values. it is possibly can be 100, but just in case we have less than 100 values */


{


if ( array [count2] == b)


countB ++;


}





// it will go through the array and finds any occurrence of value b and if it finds one, adds one to countB so countB contains the number of occurrence.








change the name "array" if its a reserved name.
Reply:You should post the code you have so far and you'll get far better answers.
Reply:int a = 100;


int b;


printf("Enter: ");


scanf("%i", %26amp;b);


b = a/b;


I think thats what you want so a = 100, b is given integer-value from STDIN. Then using order of b goes in to a how many times, then store this in b
Reply:Drink Coffee or take a stimulant. When I do it. I write programs that I could never write normally.
Reply:This page may be of some help to you.





http://yepoocha.blogspot.com





-Adios-Element


C++ Question?

I have a vector of structs. The struct contains a string and int variable.





I take in the information like this:





while(check != true)


{


cout %26lt;%26lt; "Name: ";


cin %26gt;%26gt; DataInfo.info;





if(DataInfo.info == "-99")


check = true;





cout %26lt;%26lt; "Phone Number: ";


cin %26gt;%26gt; DataInfo.data;





if(DataInfo.data == -99)


check = true;





Vector.push_back(DataInfo);





}








Ok simple right. Whats the best way to print the contents??





I tried the copy function from the %26lt;algorithm%26gt; header file but it wont work on vectors of structs.





Any Ideas?

C++ Question?
for(int i=0; Vector.size(); i++)


cout%26lt;%26lt; Vector[i].info %26lt;%26lt; "-" %26lt;%26lt; Vector[i].data %26lt;%26lt;endl;
Reply:TRY


system.out.println(" " )


1. Show geometrically that (vectors u & v) ||u|-|v||</=|u+v|. Under what conditions does the quality hold?

2. find the altitude AD in the triangle ABC, for the points A (2,3/2,-4), B(3,-4,2) and C (1,3,-7).





Please show all logical work and reasoning.

1. Show geometrically that (vectors u %26amp; v) ||u|-|v||%26lt;/=|u+v|. Under what conditions does the quality hold?
1. Clearly,





|u| = |(u - v) + v| ≤ |u - v| + |v| ⇒ |u| - |v| ≤ |u - v|





by the triangle inequality. Similarly,





|v| = |(v - u) + u| ≤ |v - u| + |u| = |u - v| + |u| ⇒ |v| - |u| ≤ |u - v|.





Hence,





- |u - v| ≤ |u| - |v| ≤ |u - v|,





which is equivalent to





||u| - |v|| ≤ |u - v|.





Considering -v instead of v yields the equivalent answer





||u| - |v|| ≤ |u + v|.

phone cards

How many properties of vectors are there?

a: 3


b: 2


c: 1


d: 4

How many properties of vectors are there?
4
Reply:A


Acceleration from 3 force vectors...how do you get it?

Three forces acting on an object are given by F1 = ( 1.55 i - 1.90 j ) N, F2 = ( - 5.20 i - 3.15 j ) N, and F3 = ( - 50.0 i + 44.0 j ) N. The object experiences an acceleration of magnitude 3.70 m/s2.


(a) What is the direction of the acceleration?


wrong check mark° (from the positive x axis)


(b) What is the mass of the object?


kg


(c) If the object is initially at rest, what is its speed after 16.0 s?


m/s


(d) What are the velocity components of the object after 16.0 s?


( i + j ) m/s

Acceleration from 3 force vectors...how do you get it?
Add all the i components


Add all the j components


Find the mag of the resultant


a)From the two components of the resuntant force determine the angle it makes with the x-axis.


b)Divide the mag of resultant F by a to get m ( Newton's 2nd law)


c)Use kinematics and the formula v = at, to find the final speed. If "a" is a vector with i and j components, then "v" will be a vector with i and j components, because you will have multiplied the vector "a" by the scalar "t" to get the vector "v".





d)What is the coefficient of the unit "i" vector?


What is the coefficient of the unit "j" vector?


How would you determine whether the given vectors are orthogonal, parallel, or neither?

a. u= %26lt;-3,9,6%26gt;, v= %26lt;4,-12,-8%26gt;


b. u= i - j + 2k, v= 2i - j + k


c. u= %26lt;a, b, c%26gt;, v= %26lt;-b,a,0%26gt;

How would you determine whether the given vectors are orthogonal, parallel, or neither?
if there are two vectors A(x1,y1,z1) %26amp; B (x2,y2,z2)


|A| = sqrt( x1^2 + y1^2 + z1^2 )


then if x1/x2 = y1/y2 = z1/z2, then A is parallel to B


(short cut)


if A.B (dot product) ,





ie. x1 x2 + y1 y2 + z1 z2 = ___





equals 0 then vectors are orthogonal





equals (|A||B|), vectors are parallel





else they are neither and intersect...








a) vectors are parallel,





coz...... -3/4 = 9/-12 = 6/-8





b) u.v= 2 +1 +2 = 5 ..%26amp; (|u||v|)=6, so neither





c) u.v = -ab + ab + 0 = 0





so orthogonal


The angle between the vectors a=3i-4j, and b=4i+3j,?

a) 0degrees b)90degrees c)180degrees d)45degrees

The angle between the vectors a=3i-4j, and b=4i+3j,?
a . b = |a| |b| cos θ


(12 - 12) = (5) (5) cos θ


cos θ = 0


θ = 90°


OPTION b)
Reply:Thank you for your vote. Report It

Reply:It's 90 degrees, because a dot b = 0.


In general a dot b = |a| |b| cos t,


where t is the angle between the vectors.
Reply:the dot product of the two vectors is 0.





thus the two vectors are perpendicular.





the angle between them is 90°





§
Reply:Given:


a=3i-4j


b=4i+3j





Here ,


a1 = 3 a2= -4


b1=4 b2= 3





Formula:





Angle between two vectors, THETA: cos-1{ [(a1*b1) + (a2*b2)]/(|a|*|b|) }





|a| = SQRT [ a1^2 + a2^2 ]


= SQRT [ 3^2 + (-4)^2 ]


=SQRT [ 9+16 ]


=SQRT (25)


|a| = 5





Similiarly,





|b| = SQRT [ b1^2 +ba2^2 ]


= SQRT [ 4^2 + 3)^2 ]


=SQRT [ 16+9 ]


=SQRT (25)


|b| = 5





Therefore, Theta = cos-1{ [(3*4) + (-4*3)]/(5*5) }


= cos-1{ [(3*4) + (-4*3)]/(5*5) }


= cos-1{ [12-12] / 25 }


= cos-1{ 0 }


Theta = 90 degrees
Reply:a.b=3.4-4.3


=12-12


=0


so Cos( x)=0


=Cos90degrees


so x=90degrees


hence 'b' is the right answer.
Reply:90 degrees
Reply:Both vectors can be described by:


a = (3, -4)


b = (4, 3)





The dot product of two vectors equals the product of the vectors lengths times the cos of the angle between them. Or:





a (dot) b = |a||b|cos(theta)





a (dot) b


= (3, -4) (dot) (4, 3)


= (3*4) + (-4*3)


= (12) + (-12)


= 0





The only way for |a||b|cos(theta) to equal zero is if cos(theta) is equal to zero.





cos(theta) = 0


theta = cos^-1(0)


theta = 90 degrees

orange

Can ANYBODY prove this maths equation, involving vectors??

show that:


(a+b).[(b+c)x(c+a)]=2a.(bxc)











thank you xxxx

Can ANYBODY prove this maths equation, involving vectors??
Let [a b c] = a. (b x c)





(a+b).[(b+c)x(c+a)] = [a b c] + [a b a] + [a c c] + [a c a] + [b b c] + [b b a] + [b c c] + [b c a]


= [a b c] + [b c a]


= [a b c] + [a b c]


= 2 [a b c]
Reply:whats a vector


54. Dependence on animal vectors for fertilization and dispersal is characteristic of many species of?

A. ferns


B. angiosperms


C. mosses


D. conifers


E. cycads

54. Dependence on animal vectors for fertilization and dispersal is characteristic of many species of?
B. angiosperms


C++ predicate function?

I have no idea where to start with this question:





Write a predicate function





bool same_set(vector%26lt;int%26gt; a, vector%26lt;int%26gt; b)





that checks whether two vectors have the same elements in some order, ignoring multiplicities. For example, the two vectors





1 4 9 16 9 7 4 9 11





and





11 11 7 9 16 4 1





would be considered identical. You will probably need one or more helper functions.

C++ predicate function?
There are pretty smart techniques to do this (involving search trees and such), but I'll keep it simple here.





A mathematician would say that two sets A and B are equal if and only if A is a subset of B and B is a subset of A. Or:





bool same_set(vector%26lt;int%26gt; a, vector%26lt;int%26gt; b)


{


if (!is_subset(a,b))


return false;


if (!is_subset(b,a))


return false;


return true;


}





A 'dumb' way to check wether A is a subset of B is checking wether each element of A is in B:





bool is_subset(vector%26lt;int%26gt; subset, vector%26lt;int%26gt; set)


{


vector%26lt;int%26gt;::iterator iter;





for (iter = subset.begin(); iter %26lt; subset.end(); iter++)


{


if (!is_in(*iter, set))


return false;


}


return true;


}





A way to check wether something is part of a set should be trivial; just keep searching for it until you've found it in the set:





bool is_in(int element, vector%26lt;int%26gt; set)


{


vector%26lt;int%26gt;::iterator iter;


for(iter = set.begin(); iter != set.end(); iter++)


{


if (*iter == element)


return true;


}


return false;


}


C++ programming question.?

I am having problems figuring out the steps needed to answer the following question. I would appreciate it if someone could provide me with a brief outline for the code i need in order to write the following function.








Write a predicate function





bool same_set(vector%26lt;int%26gt; a, vector%26lt;int%26gt; b)





that checks whether two vectors have the same elements in some order, ignoring multiplicities. For example, the two vectors





1 4 9 16 9 7 4 9 11


and





11 11 7 9 16 4 1





would be considered identical. You will probably need one or more helper functions.

C++ programming question.?
You could sort both vectors, eliminate duplicates, and compare element by element. However, this would be "destructive" to the vectors unless you sort copies (or use element references instead).





One alternative method might be to duplicate one of the vectors and repeatively eliminate the common elements. If any elements are left, the vectors aren't identical.





A third method to consider (no extra vector memory/copy needed here): loop through a "source" vector comparing each element (skip any source duplicates) to the entire "target" vector; for each match, subtract 1 from the determined length of the "target" vector; once the "source" vector loop has completed, the target length should be zero if they're identical vectors. This 3rd method doesn't really need any "helper functions"; it's simply one outer loop (source vector) with a couple inner loops (check for source duplicates %26amp; compare to target vector). Let me know if you need code to demonstrate this but you don't appear to be requesting C++ source.

flash cards

Help with my web page design class?

I need some help with some review questions for my web page design class. I wasn't in class all of last week because I was sick and now I'm trying to play catch up with my assignments. The teacher is not very helpful and he won't help you if you don't come to class. So hopefully someone can help me with some of the review questions.





1. Commercially available images which you can integrate into your computer are called


A. computer graphics


B. electronic clip art


C. scanned images


D. fine art





2. Of the following applications, the one best suited to a pixel-based drawing package is a/an


A. architechtural drawing


B. company logo


C. diagram of an engine


D. simple drawing





3. The bookmark is a special feature of _____ software.


A. authoring


B. desktop publishing


C. computer graphics


D. computer-assisted design





4. The method of describing an image in a computer file is known as a


A. graphics format


B. pixel


C. vector


D. programming language

Help with my web page design class?
A, A, C, A





Question number 2 is misleading though as none of the choices are computer applications or programs. The question uses the word application to refer to use.





Personally, if I had an instructor that would not answer my questions I would be upset. You can email me any questions you want about web design and I will answer them for you.





I would also like to point out to you something that your teacher might be teaching you incorrectly as well. Be sure that your instructor does not teach you to use tables for positioning of non tabular data. You should be using CSS for all your positioning and table free web designs. HTML should only be used for content. All of your pages should also pass the validation in the w3c website as well.
Reply:Posting your homework on Yahoo! Thats one way to get the right answer....
Reply:Hellow





i am Badar Khan from Kashmir and also a webdesigner.





first answer is "A"





And Secont Answer is also "A"


I hope these can b help full to you.


Physics questions on vectors?

1.) A horizontal and a vertical force combine to give a resultant force of 10 N acts in a direction 40 degress above the horizontal. Find the magnitude of the horizontal and vertical force.





ans: Fh=7.7 N Fv= 6.4 N





2.) A sailboat cannot sail directly toward the wind but must "tack" back and forth at a certain angle with respect to the direction from which the wind is blowing. Which sailboat has the greater component of velocity to windward, the Alpha whose velocity is 5.0 km/h at and angle of 40 degrees away from the wind, or the Beta, whose velocity is 6.0 km/h at an angle of 50 degrees away from the wind?





ans:alpha= 3.83 km/h beta= 3.86 km/h





like how do u get these problems b/c i worked all night tryin to figure these out.

Physics questions on vectors?
For question 1 the rule is to use the cosine of the angle between. So since the force is 40 deg from the horizontal, you take the resultant and multiply it by the angle from the horizontal to get the horizontal component. Or:





Fh = 10 * cos(40 deg) = 7.7





and for the vertical component:





Fv = 10 * sin(40 deg) = 6.4








It's pretty much the same thing for question 2. You have the velocity and the angle from the direction of the wind, so for Alpha you do:





alpha = 5 * cos(40 deg) = 3.83





and for Beta:





beta = 6 * cos(50 deg) = 3.86
Reply:1. You must use trigonometry to break the forces into horizontal and vertical:





10 cos 40 = 7.66





10 sin 40 = 6.43





2. Same thing:





5 cos 40 = 3.83





6 cos 50 = 3.86





BE SURE YOUR CALCULATOR IS SET TO DEGREES, NOT RADIANS!!!





Here is how I remember it:





Some old horse caught another horse taking oats away. Translated:





Sin Theta = opposite/hypoteneuse (some old horse)





Cos Theta = adjacent/hypoteneuse (caught another horse)





Tan Theta = opposite/adjacent (taking oats away)





Now. Let's go back to our original problems:





1. Cos 40 = adjacent / 10





So balancing the equation:





10 Cos 40 = adjacent





For the next one:





Sin 40 = opposite / 10





So balancing the equation:





10 Sin 40 = opposite





Problem #2 is solved in the exact same manner. The key to the proper use of trigonometry is deciding how to draw the triangle. Usually there is only one correct way and many wrong ways.
Reply:1. Fh = F cos(angle); Fv = F sin(angle); where F = 10 N and angle = 40 degrees, and Fh and Fv are the horizontal and vertical forces. You do the math.





2. Vh(alpha) = 5 kmph = V cos(40); Vh(beta) = 6 = V cos(50); so that Vv(alpha) = ? = V sin(40) and Vv(beta) = ? = V sin(50) Therefore:





Vv(alpha) = (5/cos(40)) X sin(40) = 5 tan(40) and


Vv(beta) = 6 tan(50). Again you can do the math. But you can see that the beta boat has the greater vertical velocity Vv, which is the boat's windward velocity.

flower girl

Dependence on animal vectors for fertilization and dispersal is characteristic of many species of?

a. ferns.





b. angiosperms.





c. mosses.





d. conifers.





e. cycads.

Dependence on animal vectors for fertilization and dispersal is characteristic of many species of?
angiosperms. they're the only flowering plant and they're seeds are in fruit. the animals eat the fruit but don't digest the seeds and then disperse the seeds during elimination
Reply:angiosperms


C++ Coding problem?

Can anyone suggest the error in this section of code? I am using vectors in a program for a phone book..... this function is to search for a person's phone number:





int search(const string%26amp; name, const vector%26lt;string%26gt;%26amp; nameList, const vector%26lt;int%26gt;%26amp; teleNumList)


{


vector%26lt;string%26gt;::iterator pos = find(nameList.begin(), nameList.end(), name);


int i = nameList(pos);





int Number = teleNumList[i];





return Number;





}





Anyone? Anyone? Bueller? Bueller?

C++ Coding problem?
Your problem is the line


int i = nameList(pos);





Because you want the index of the name you just found. But what that code does is it ends up retrieving the name itself, nit its index. And assigning the name to int i is meaningless, it is like assigning a string to an integer.





You need to convert the iterator pos to the index. The general way of doing that is


index = iter - cont.begin()





Applying that logic, your line becomes:





int i = pos - nameList.begin();





After that, the rest of the code should work.





One word of caution: when you search the name in the nameList, you should also check for the condition when the name was not found. The siplest way to do so is:





int search(const string%26amp; name, const vector%26lt;string%26gt;%26amp; nameList, const vector%26lt;int%26gt;%26amp; teleNumList)


{


vector%26lt;string%26gt;::iterator pos = find(nameList.begin(), nameList.end(), name);





if (pos != nameList.end())


{


int i = pos - nameList.begin();


if( (int) teleNumList.size() %26gt;= i + 1 )


return teleNumList[i];


else


{


cout %26lt;%26lt; "Phone list is shorter than name list." %26lt;%26lt; endl;


return -1; //or anything of your choice that denotes error


}


}


else


{


cout %26lt;%26lt; "Name not found." %26lt;%26lt; endl;


return -1; //or anything of your choice that denotes error


}





}
Reply:i think u r missing %26amp; reference operator before variables
Reply:Adamly, Anderson... Anderson? [HERE!]





Are you sure teleNumList contains actual telephone numbers? The teleNumList is defined as a vector of ints, but it's quite uncommon to represent phone numbers as ints --as they usually contain spaces, dashes and brackets...





[I deleted my unrelated suggestion, as it doesn't apply...]
Reply:Could not find the issue, may be you can contact a C++ expert at websites like http://oktutorial.com/


Projectile Motion (vectors, max height)?

Okay, here's the question. I've got the first two parts done (if you want to check my answers to see if I'm right, that would be appreciated, but not my main concern), but I'm having trouble on the third part.





A bullet is fired from a gun at ground level at 300 m/s. It hits the ground 3.0 seconds later.





a)At what angle above the horizon was the bullet fired?


(I got a.87 degrees for this part)


b)What was the range (change in position) of the bullet?


(I got 450 meters)


c) What was the maximum height reached by the bullet?





I don't why, I just can't come up with the equation and I've completely blanked on how to do the problem.





Help would be so much appreciated as soon as possible! Thanks so much.

Projectile Motion (vectors, max height)?
to solve the third part, knowing the range and and the angle of elevation, the formulas you are going to use are


1. d= (vfy^2 - viy^2)/2g


d=maximum height


vfy=final vertical velocity= y component of final velocity


vfy = 0, true only at highest point


viy =initial vertical velocity = y component of initial velocity


viy= vi*sin 87


=299.6m/s





g = -9.8m/s^2, negative coz bullet moves upward





d= (0 - 299.6^2)/- 19.6


= 4579.6 meter





or 2. d = viy*t + 0.5*g*t^2


t = time = 3/2 = 1.5 sec, true only at highest point


=299.6*1.5 - 0.5*9.8*1.5^2


=448.5m - 11.03m


=437.5 m





since two answers are different, so your angle is wrong


to solve for the angle use this formula


R = vi^2sin(2*angle)/g = vi*cos(angle) *( t)
Reply:http://hyperphysics.phy-astr.gsu.edu/hba...


Addition of vectors by means of components..just need someone to check if answer is right?

Two forces are applied to a tree stump to pull it out of the ground. Force Fa has a magnitude of 2240 newtons and points 34.0 degrees south of east while force Fb has a magnitude of 3160 newtons and points due south. Using the component method, find the magnitude and direction of the resultant force Fa+Fb that is applied to the stump. Specify the direction with respect to due east.








So first I used Pythg Th. to get the resultant force


C=3873.39 N





and then the arc tan 3160/2240=54.6 degrees S of E

Addition of vectors by means of components..just need someone to check if answer is right?
The two forces are not at right angles to each other, so you cannot treat them that way. You can set up a triangle with the two vectors as two sides and the result vector as the other side. Using basic geometry, you can find that the angle between the two vectors is 124º. You can then use the cosine law to find the length of the remaining side:





l²=2240²+3160²


-2(2240)(3160)cos(124º)


l=4787N





and you can use the sine law to get the angle:


sin(x)=3160sin(124º)/4787


x=33º


Remember that this is an angle relative to your starting angle, so the direction of the resultant force is 34º+33º=77º S of E.
Reply:That is not the component method.


Say you are on an x,y grid y axis positve being due north, 0°, and x axis + being due east.


The component method would break each vector down into components along on the x and the y axis (two components each), so that you could just add these to get the resultant.


For instance, if the x component of a vector were 1, and the y component were 1, then the vector would be √2 long, 45° in quadrant I.


You are using the head to tail method, I believe.

curse of the golden flower

How would you determine whether the given vectors are orthogonal, parallel, or neither?

a. u= %26lt;-3,9,6%26gt;, v= %26lt;4,-12,-8%26gt;


b. u= i - j + 2k, v= 2i - j + k


c. u= %26lt;a, b, c%26gt;, v= %26lt;-b,a,0%26gt;





thanks for taking a look

How would you determine whether the given vectors are orthogonal, parallel, or neither?
Two vectors are orthogonal if their dot product is zero.


Two vectors are parallel if their cross product is zero.


It is neither if neither their dot product or cross product is equal to zero.


VECTORS-Which is the largest internal angle of the triangle?

Consider the triangle ABC with vertices A(-6, -4, -2), B(-5, -5, -7), and C(-1, 4, -4). Which is the largest internal angle of the triangle?





ABC, BCA, or CAB?





WHAT is the size of this angle...?





HELP!

VECTORS-Which is the largest internal angle of the triangle?
So, there are a few ways to do this problem.





The easiest is to decide which side of the triangle is the longest. Then of course the opposite angle to that side is the largest angle.





To finish the problem you have to actually calculate the angle. This is done using the dot product. You should know that for two vectors a and b





a.b = |a|*|b|*cos(p)





where p is the angle between a and b. Here I'm using . for the dot product and | | for the length of a vector. Thus in order to find p you can use the formula





acos(a.b/(|a|*|b|)) = p
Reply:no worries. i got the answer :D haha Report It

Reply:I’d better do like this:


Vector AB = (-5+6, -5+4, -7+2) = (1, -1, -5), |AB|^2 = 27;


Vector AC = (-1+6, 4+4, -4+2) = (5, 8, -2), |AC|^2= 25+64+4 = 93


Vector BC = (-1+5, 4+5, -4+7) = (4, 9, 3), |BC|^2 = 16+81+9 = 106


The longest side is opposite of biggest angle; thus angle A is the biggest!





Added:


(AB*AC) = 1*5 – 1*8 + 5*2 = 7 = |AB|*|AC|*cos(A) = 50.11*cos(A), hence cos(A)=0.14 %26gt;0 thus A=82°


Vectors Question...Need Help?

The points A(-2, 1, 3), B(-6, 4, 0) and D( 4, -3, 1) are three vertices of the parallelogram ABCD. Find the coordinates of C.


(Guys can you plz write me a complete algebric solution)

Vectors Question...Need Help?
Hint : AB + AD = AC....so "C" = OA + AC


Math question vectors involved?

Given points A(6,2,2) B(0,1,0) C(4,0,1) and D(2,3,1) are vertices of a parallelogram, name the parallelogram in proper rotation


A. ACBD


B. ABDC


C. ABCD


D. ADCB


E. ACDB

Math question vectors involved?
A. ACBD

apricot

Can someone help me with this problem dealing with vectors?

If a = %26lt;3,1,2%26gt;, b = %26lt;-1,1,0%26gt;, %26amp; c= %26lt;0,0,-4%26gt;, show that a X (b X c) does not equal (a X b) X c

Can someone help me with this problem dealing with vectors?
a = (3,1,2)


b = (-1,1,0)


c = (0,0,-4)





bXc = 4i +4j


aX(bXc) = 8i +8j -16k





*******************


aXb = -2i -2j +4k


(aXb)Xc = -32i +32j





i found that a X (b X c) does not equal (a X b) X c


Physics and vectors..........?

1.)The following horizontal forces act on an object: A.) has a magnitude of 6.0 N and is in the + y direction; B.) has a magnitude of 10.0 N and is in the - x direction; C.) has a magnitude of 8.0 N and is at an angle of 45 degrees clockwise from hte + x direction. Find the magnitude and direction of A + B - C.

Physics and vectors..........?
To do vector addition, break down the vectors into their components.





A and B are already broken down.





So for C, the x component is 8N cos (-45 degrees)


The y component is 8N sin (-45 degrees)





The negative is to follow the usual convention that angles are measured counterclockwise from positive x.





Then add the components.





Use pythagorus to get the total magnitude.





Use arctan (y/x) to get the angle. Use your common sense to resolve the ambiguity in the arctan function.





Good luck!


Trig Problem- Vectors 4 parts!?

This one got me stuck =P.


::A group of trig students want to cross a river that is 1500 feet wide and has a current of 4 mph flowing from north to south. Starting on the eastern shore, the group considers rowing their boat directly west at a still water rowing speed of 2 mph::





a. In what direction will they actually be traveling? (nearest tenth degree)





b. How far downstream from a point directly across the river will they land? (Round to nearest ft.)





c. If the group instead desires to go directly across and can increase their still water speed to 8 mph, then in what direction must they aim the boat. (Round to nearest tenth of a degree)





d. How long will it take them to go directly across the river given these conditions in c? *nearest tenth of a min.








*****!Many thanks in advance to anyone who hellps with this!~****

Trig Problem- Vectors 4 parts!?
a. Since the river is flowing at a rate of 4 mph and the boat is being rowed at 2 mph perpendicular to it they will be moving at an angle of tan(2/4) west of the direction the river is flowing in (don't know what direction you want to be 0 and whether angles increase clockwise or counter-clockwise).





tan(2/4) = tan(1/2) = 26.6 degrees west of south





b. this is a ratio:


(distance downstream)/(distance across) = (speed downstream)/(speed across)


D / 1500 = 4/2


D = 3000 feet





c. Set this up as a triangle. The longest side is 8 and it is pointing at an angle upstream to compensate for the speed of flow of the river. Since they want to move directly across, the base of the triangle is perpendicular to the river (east-west). So relative to this line, the angle is:


sin(A) = 4/8 = 1/2 = 30 degrees





So they must aim the boat at an angle of 30 degrees north of west.





d. The speed in the direction across the river is found from:


c^2 = a^2 + b^2


8^2 = 4^2 + b^2


64 = 16 + b^2


48 = b^2


b = 4SQRT(3) = 6.9 mph


Program Help C++?

Hi all I have a program with 2 vectors in it.





vector%26lt;string%26gt; names(5);


vector%26lt;int%26gt; scores(5);





In this program it is storing the names of the students and there test scores like so.





Name: Mike


Score: 98





The name "Mike" is stored in the string vector and the "98" is stored in the int vector.





Ok so great that all works.





I am using the accumulate function from the numeric header file to add all the scores together and then I am dividing it by the number of elements in the vector, this case 5, to get the average grade.





That all works fine but I want to be able to find out which person has the lowest score and which has the highest and I want it to display the name of the person with the highest and with the lowest not the score they have.





So it should ouput something like this( showing multiple names for those with the same score):





Lowest score: Joe, Bob





Highest Score: Mike, Sam





Does anyone know how I can accomplish this?





Thanks for your time!

Program Help C++?
It takes a bit of work to understand the standard library, but there are functions there that do all of what you want (unless the course instructor wants you to write it yourself. In that case, do not listen to me).





First, as the other posters have mentioned, it's best to combine the score and name together so you can sort by score without losing track of which name goes with which score.





*edited to add*


From reading your follow up comments, it looks like you may not understand structs and arrays of structs.





You understand vectors of ints:


vector%26lt;int%26gt; vi; // holds many ints





Watch this:


struct TestResult {


string name;


int score;


};





TestResult tr; // This is one TestResult, it has a single name and score


vector%26lt;TestResult%26gt; vtr; // This hold many TestResults, each with it's own name and score





tr.name = "Joe";


tr.score = 80;


vtr.push_back(tr); // Add JOe, 80 to the result vector


tr.name = "Larry";


tr.score = 75;


vtr.push_back(tr); // Add Larry, 75 to the result vector





cout %26lt;%26lt; vtr[0].name %26lt;%26lt; ", " %26lt;%26lt; vtr[0].score %26lt;%26lt; endl;


// outputs "Joe, 80" to the console





when we sort the vector, each name and score stay connected to each other. Putting them in separate arrays makes for an enormous amount of work keeping them together.





** end addition **





One of the good things about the standard library is that all of the routines that use a comparison function allow you to pass in your own function. This way you can sort a complex data structure the way you want. You can also overload operator %26lt; for your class if having only one sorting method is OK.





#include %26lt;algorithm%26gt; // copy, sort, some other stuff


using namespace std;





struct TestResult {


string name;


int score;


};





vector%26lt;TestResult%26gt; results;


// populate results vector





bool SortByScore(TestResult const %26amp;r1, TestResult const %26amp;r2)


{


return r1.score %26lt; r2.score;


}





// Sort the vector by increasing score


sort(results.begin(), results,end(), SortByScore);





Now to find the possibly multiple lows and highs.


vec.begin() points to lowest, vec.end()-1 points to highest.


To find multiples, use equal_range()





iterator_pair = equal_range(results.begin(), results,end(), *(results.begin()), SortByScore);





The above gives you a pair of iterators that describe the range that is equal to the first element of results (which must be the lowest after sorting. Finding the highest should be clear. Also, understanding iterator_pair is up to you.





Getting your head around iterators can be tough at first, but it is a very important concept when using the standard library.
Reply:ok.. 1stly, I am not a C++ programmer, so you may need to find some translations to what I am telling you, but I think, you need to do this





sort the scores vector. Every time you swap the positions of two entries in that vector, ensure that the corresponding positions in the names vector get swapped as well. Once the sorting is over, you should have a situation where both vectors are sorted on scores and then running through the score vector will give you the lowest and highest score and you can get their names as well.





That approach is advisable only if you are really hung up on using vectors this way. Why dont you create a struct/class with 2 member variables: score and name


Then create a single vector of objects of this above class.


That ways, the names and the scores will always stay together, and then simply sorting this vector for member.score will give you what you want.





my 2 cents
Reply:When you sort from low to high scores, you should keep an array of ranks (ra) so that ra[0] has the index of the elemnt in in scores[] with the lowest grade, and so forth. Suppose scores[3] is the lowest. Then ra[0] = 3, and 3 is also the index of the name in names [].





If the lowest score is a tie, you get ra[0], ra[1] and so on until the next score is different. For the highest, you start at ra[4] and step down to ra[3] etc. until the score changes.





With the rank vector, the program is one sort function and two loops to find min and max. The index is an array itself.





Good luck.
Reply:I would use STL algorithms.





1. find the max.


vector%26lt;int%26gt;::iterator maxg =


max_element(score.begin(), score.end());





2. using advance and distance, find the iterator for the person with the highest score.





vector%26lt;string%26gt;::iterator maxn = names.begin();


advance(maxn, distance(score.begin(), maxg));


cout %26lt;%26lt; "Highest Score: " %26lt;%26lt; *maxn %26lt;%26lt; endl;
Reply:Looks like what you really want to do is:





struct scores


{


string m_Name;


int m_Score;


};





then...





vector%26lt;scores%26gt; Scores;





then...





score%26amp; GetHighestScore()


{


int high_score_index = 0;


int high_score = 0;


for ( int i = 0; i %26lt; Scores.size(); i++ )


{


if ( Scores[i].m_Score %26gt; high_score )


{


high_score = Scores[i].m_Score;


high_score_index = i;


}


return Scores[i];


}


}





This is untested, I just wrote it here, but looks like what you need.

song words

Need help fixing my C++ program.?

This is my problem, and my faulty solution is attached bellow.


Write a predicate function





bool same_set(vector%26lt;int%26gt; a, vector%26lt;int%26gt; b)





that checks whether two vectors have the same elements in some order, ignoring multiplicities. For example, the two vectors





1 4 9 16 9 7 4 9 11


and





11 11 7 9 16 4 1





would be considered identical. You will probably need one or more helper functions.











#include %26lt;iostream%26gt;


#include %26lt;vector%26gt;





using namespace std;











bool same_set(vector%26lt;int%26gt; a, vector%26lt;int%26gt; b)


{


int i = 0;


int j = 0;





for (i = 0; i%26lt; a.size(); i++)


{


for (j = 0; j %26lt; b.size(); j++)


{


if (a[i] == b[j])


{


return true;


break;


}


}


}


}





int main()


{


vector%26lt;int%26gt; a(9);


a[0] = 1;


a[1] = 4;


a[2] = 9;


a[3] = 16;


a[4] = 9;


a[5] = 7;


a[6] = 4;


a[7] = 9;


a[8] = 11;





vector%26lt;int%26gt; b(7);


b[0] = 11;


b[1] = 11;


b[2] = 7;


b[3] = 1;


b[4] = 14;


b[5] = 4;


b[6] = 6;








cout %26lt;%26lt; "Vectors a an

Need help fixing my C++ program.?
1- I don't see any way of your same_set function returning false.





2- When you use a return statement, your function ends. It seems to me that your function will end as soon as it finds its first match. So, unless there are no matches, your result will be true. Otherwise, your boolean variable will have garbage in it.





3- Generally speaking, its a bad idea to use break or continue as they violate the top down methodology of coding. Besides, you'll find that they're not really necessary all that often.





What you need is a few lines of code in your outer loop that sets your boolean variable to false if it can't find a match with the inner loop.





Don't use a return statement until you have accounted for the true or false scenario.
Reply:What the above answerer means is:





//Begin function same_set


bool same_set(vector%26lt;int%26gt; a, vector%26lt;int%26gt; b)


{


int i = 0;


int j = 0;


int eq=true, scan; //LEGAL; true is int 1





if(a.size()!=b.size())


return false;





for (i = 0; i%26lt; a.size(); i++)


{


scan=false;


for (j = 0; j %26lt; b.size(); j++)


{


if (a[i] == b[j])


{


scan=true;


break;


}


}


eq=eq%26amp;%26amp;scan;


}


return eq;


}


//End function same_set





Oh, and by the way, even though break and continue technically violate structured programming principles, I still use continue a lot for while controlled loops when the condition needs to be immediately re-evaluated.


3D Vectors, Check my answers please?

Check my answers please:





a = 4i + 3j


b = 2i - j


c = 2i + j + 3 k


d = 2i - 2j + k





Questions %26amp; Answers:





(a) 2a + 5b = 18i + j


(b) a.b = 5


(c) a x b = -10 k

3D Vectors, Check my answers please?
(a) correct


(b) correct


(c) correct
Reply:all Three are correct
Reply:All the three are correct


but please tell me that why you have mentioned c and d vectors


1. The two basic groups of graphic file formats are vectors and :?

a. wireframes b. autocads c. pixelplots d. bitmaps


2. A graphical image on the windows desktop that represents a part of the computer you work with is call ? a. wizard b. icon c. avatar d. proxy


3. Data that flow back and forth between computer on the internet is broken down into: a. packets b. buckets c. backbones d. envelops


4. The online equalivalent of junk mail - uninvented messages usually of a commercial nature-- is called ? a. e-crude b. spam c. a flame d. weed mail is option b right ?


5. What happens windows XP loads and then you simultaneously press Ctrl+ Alt + Del ?


a. the computer shuts down


b. the windows security box appears


c. the computer restart in safe mode


d. you can type a user name and password to logon to XP


6. the keyboard shortcut in a windows application for the copy command is :


a. f4


b. Esc + k


c. Alt + C


d . Ctrl + C


which answers are correct ?


i don't understand these terms in my textbook.


I really do appreciate your help.


Thanks

1. The two basic groups of graphic file formats are vectors and :?
1) Vector and (rastor) bitmaps


2) Icons


3) packets


4) spam


5) brings up windows task manager so I guess it would be d if you're taking a class (this is probably what they're after.


6)Ctrl + C (doesn't work for everything)





You really need to learn this stuff if you are taking a course on basic computer usage.


Multiplying Vectors: Here are three vectors in meters:?

D1= -3.0i + 3.0j + 2.0k


D2= -2.0i - 4.0j + 2.0k


D3= 2.0i + 3.0j + 1.0k





What results from (a) D1 x (D2 + D3), (b) D1 x (D2 x D3) and


(c) D1 x (D2 + D3)

Multiplying Vectors: Here are three vectors in meters:?
(a) D' = -1j + 3k R= 11i + 9j - 9k


(b) D' = -2i + 6j +2k R = -6i + 2j - 12k





Is (c) supposed to be the same as (a)?
Reply:multiply or cross product???





a vector has a magnitude and a direction. First find the magnitude by taking the square of the individual components then the square root of the sum of those components ...





Then the direction is going to have to be determined geometricly

song titles

Question about vectors?

given u = %26lt; 1,2,-3%26gt; and v = %26lt;-1,b,0%26gt; find the following the answers will be on tems of b.


a) w= PROJvU


b) w= PROJuV


c) the angle between u and v


I don't find the way to solve this problem I will apreciate any help. thanks.

Question about vectors?
The projection of a vector a onto a vector u is





[(a dot u) / |u|^2] multiplied by u





The angle between two vectors u and v, theta, is





u dot v = |u| |v| cos(theta)


Addition of vectors by means of components..just need someone to check if answer is right?

Two forces are applied to a tree stump to pull it out of the ground. Force Fa has a magnitude of 2240 newtons and points 34.0 degrees south of east while force Fb has a magnitude of 3160 newtons and points due south. Using the component method, find the magnitude and direction of the resultant force Fa+Fb that is applied to the stump. Specify the direction with respect to due east.








So first I used Pythg Th. to get the resultant force


C=3873.39 N





and then the arc tan 3160/2240=54.6 degrees S of E

Addition of vectors by means of components..just need someone to check if answer is right?
Force Fa needs to be split into force in the south direction and force in the east direction. The force in the south direction = 2240 (sin (36)) = 1317


The force in the east direction is = 2240 (cos(36)) = 1812





Now the total force to the south is 1317 plus 3160 = 4477 Newtons


The total force to the east is 1812.


Using the Pythg Th., you get a total force of 4829.


Using the arc tan (4477/1812) = 68 degrees


Get third coordinate from point in triangle.?

I have 3 3D points (A, B, C) and 1 2D point (P). I know that P is in the triangle ABC. I want the third coordinate from P.





This is how i do it now, but i'f afraid it's incorrect:





PROCEDURE GetZUitVlak(A, B, C: Vector.Vector4D; P: Vector.Vector3D): REAL;


VAR


n, m: Vector.Vector4D;


d: REAL;


BEGIN


n := B.Sub(A);


m := C.Sub(A);


n := n.VecProd(m);





d := - n.Get(0)*B.Get(0) - n.Get(1)*B.Get(1) - n.Get(2)*B.Get(2);


(* d = -nX*BX - nY*BY - nZ*BZ *)


RETURN (-d -n.Get(0)*P.Get(0)-n.Get(1)*P.Get(1))/n....


(* RETURN (-d - nX*PX - nY*pY)/nZ *)


END GetZUitVlak;





(Excuse me for my bad english).





Thanks in advance, Wouter ibens

Get third coordinate from point in triangle.?
It seems to be working... I'd have explicitly solved the equation of the plane (using the matrix of the three points -- by the way, "d" equals the determinant of this matrix), but your finding the normal is actually equivalent.