I got a problem...A huge one..

Pages: 123
firedraco and I :P


You're incorrect. It is, in fact, "firedraco and me". We were not the subject of the sentence, therefore you don't use the subject form of the pronoun.

The easy way to remember is to remove "firedraco and" and see how it sounds. You wouldn't say "I'm glad you know so much about I".

Good point. If someone wants to truly learn about a subject they will probably do extensive research before resorting to asking questions.


Again, I'm not opposed to him asking questions. I never was. I'm all for helping him with his questions.

My problem is that he asked for a full solution to his homework problem.
Last edited on
Hi disch,

the problem is:

you are angry.
I do not need to.
Let's help each other.
t hurt one of us a bad words

of course not going to do homework but people should not belittle.

We know we are hard for people to help.

with regards to.


closed account (EzwRko23)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// find length of side a using p1 and p2
double a = sqrt( ( p2.get_x()-p1.get_x() )*( p2.get_x()-p1.get_x() ) + ( p2.get_y()-p1.get_y() )*( p2.get_y()-p1.get_y() ) );

// find length of side b
double b = // as above using p2 and p3 - simply substitute p3 for p1

// find length of side c
double c = // as above using p1 and p3 	

double cosMin = 0.0;// so it's initialized
if( a<b && a<c )// then a is the shortest side			
	cosMin = ( b*b + c*c - a*a )/(2.0*b*c);// from law of cosines
else
{
	if( b<a && b<c )// b is shortest					
		cosMin = ( a*a + c*c -b*b )/(2.0*a*c);
	else// c is shortest			
		cosMin = ( a*a + b*b -c*c )/(2.0*


Sqrt? Conditions? WTF?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
class Vector2 {
public:
    double x;
    double y;
    Vector2(double ax, double ay): x(ax), y(ay) { }
    Vector2 operator- (const Vector2& v) { return Vector2(x - v.x, y - v.y); }
    double operator* (const Vector2& v) { return x * v.x + y * v.y; }
};


Vector2 a(x1, y1);  // x1, y1 read from user input
Vector2 b(x2, y2);  // x2, y2 read from user input
Vector2 c(x3, y3);  // x3, y3 read from user input

double angle1 = acos((a-b)*(a-c));
double angle2 = acos((b-a)*(b-c));
double angle3 = acos((c-a)*(c-b));



Last edited on
Disch why are u so angry to the world?
Hi alexbg,


better magnify the event.
Making no longer.

Apologize to anyone else in the forum.
Topic bow.

of course still take advantage of this forum that you want.
if not, please close this topic.


best regards.
xorebxebx, sure, classes are nice, but I'll point out some flaws anyway:
1. the most simple one : OP most likely has no clue what classes are.
2. your code doesn't quite do what it's supposed to:
a) no relation to the library OP uses
b) angle1 = acos((a-b)*(a-c)) is only true if a-b and a-c are unit vectors (sqrt here).
c) it doesn't choose the smallest angle (conditions here).

Generally I consider it inappropriate to wrap such trivial computations in classes (Though of course a decent library would provide a vector class). The way I'd do it is.
1
2
3
4
5
6
7
8
9
10
double GetLen(double x, double y){ return sqrt(x*x + y*y); }

double a = Getlen(p1.get_x()-p2.get_x(), p1.get_y()-p2.get_y());
double b = Getlen(p1.get_x()-p3.get_x(), p1.get_y()-p3.get_y());
double c = Getlen(p3.get_x()-p2.get_x(), p3.get_y()-p2.get_y());

if(c > a) std::swap(c, a);
if(c > b) std::swap(c, b);

float minimal_angle_cosine = ( a*a + b*b - c*c )/ 2/ a/ b;
@ firix: As you pointed out this is a forum. A public forum. Don't waste your time trying to police it to your own wimpy, politically correct standards. Disch and company has as much right to voice their opinions about other posters as you do to voice yours about them. These sites have moderators to step in if things get out of hand and they really don't need your help doing their jobs.

@ alexbg: I don't think Disch is angry at the world. Perhaps he simply doesn't like the idea of someone taking the easy way out by taking credit for someone else's work. I agree with his assessment that you probably didn't learn anything this way. Find out. Now that you've seen how to do it, open a blank C++ editor right now and try to write it yourself. I'll bet you can't but you need to be able to because next weeks studies will rely on the foundation you should have learned this week.

@ Disch: I know you don't need me coming to your rescue or speaking for you. This is just one of those threads that's gotten emotionally charged and people like to add their 2 sense (ha).
@cnoeval:What are you talking about.who are you.You speak such nonsense.Advocate, and I do not blame anyone.unbalanced unbalanced speech.The only problem is my lack of want..You understand kuzo
so do not ask questions out of the man says.
asks the man.
should ask.

does not want to answer do not want to answer.
Do you understand me, dear hıro.

we know something.

I can not make up mind to anyone..
I do not.
you can not give us reason.
off topic.
HaHAHAHHAAAAAAAAAAAAAA
Speaking of "nonsense"... 8^D

es diyatennım Cnoval.
es kuze tennım kunek
es kune kızetennım.
es.jıne tennım.

ok Cnoval kunek. 767.*,43 | | 64
// This is such a fun, and confusing, topic. Lmao, wtf is this:
ok moorecm, but i think u should explain to me whats internet first, i am a monkey,u know..

// I mean completely no offense, but this topic is boggling my mind and cracking me up xD. Am I missing something(other than all the deleted posts)?
closed account (EzwRko23)
@hamsterman: ok, agreed. I haven't tested the code - anyway, when having a vector class it is much simpler to understand what the code does, just because of the DRY principle and separation of concerns. It is not easy to understand what is going on if you construct the result by direct application of low level funtions (like sqrt).

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
class Vector2 {
public:
    double x;
    double y;
    double length() { return sqrt(x * x + y * y); }
    Vector2(double ax, double ay): x(ax), y(ay) { }
    Vector2 operator- (const Vector2& v) { return Vector2(x - v.x, y - v.y); }    
    Vector2 normalized() { double l = length(); return Vector2(x / l, y / l); }
    double operator* (const Vector2& v) { return x * v.x + y * v.y; }
};


Vector2 a(x1, y1);  // x1, y1 read from user input
Vector2 b(x2, y2);  // x2, y2 read from user input
Vector2 c(x3, y3);  // x3, y3 read from user input

double angle1 = acos(((a-b)*(a-c)).normalized());
double angle2 = acos(((b-a)*(b-c)).normalized());
double angle3 = acos(((c-a)*(c-b)).normalized());
Last edited on
Nohbdy wrote:
// This is such a fun, and confusing, topic. Lmao, wtf is this:
ok moorecm, but i think u should explain to me whats internet first, i am a monkey,u know..
Nohbdy wrote:

// I mean completely no offense, but this topic is boggling my mind and cracking me up xD. Am I missing something(other than all the deleted posts)?


I think that translates roughly to, "I didn't read the link you gave me."
Last edited on
Topic archived. No new replies allowed.
Pages: 123