#Help passing information
14 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.
void MatrixInverse (void)
{
double inva11, inva12, inva21, inva22;
inva11 = (d/((a * d) - (b * c)));
inva12 = (-b/((a * d) - (b * c)));
inva21 = (-c/((a * d) - (b * c)));
inva22 = (a/((a * d) - (b * c)));
cout << "The inverse of the matrix is: " << endl;
cout << "a11: " << inva11 << endl;
cout << "a12: " << inva12 << endl;
cout << "a21: " << inva21 << endl;
cout << "a22: " << inva22 << endl;
}
void Multiplication(double alph, double bet)
{
double x, y;
alpha = alph;
beta = bet;
x = (alpha * (d/((a * d) - (b * c)))) + (beta * (-b/((a * d) - (b * c))));
y = (alpha * (-c/((a * d) - (b * c)))) + (beta * (a/((a * d) - (b * c))));
}
void SetAB (void)
{
x = (alpha * (d/((a * d) - (b * c)))) + (beta * (-b/((a * d) - (b * c))));
y = (alpha * (-c/((a * d) - (b * c)))) + (beta * (a/((a * d) - (b * c))));
cout << "Your x and y are: " << endl;
cout << "x: " << x << endl;
cout << "y: " << y << endl;
}
};
```cpp
int main() {
return 0;
}
```
you can make your inverse function modify the object members abcd instead
the code using this class should do get some return value from Multiplication (poor name btw needs to be more descriptive), then pass that along to SetAB
How exactly do i do that?
You can return a struct or a pair of doubles
I'm a beginner can you, maybe show me?
This question thread is being automatically closed. If your question is not answered feel free to bump the post or re-ask. Take a look at !howto ask for tips on improving your question.
struct foo
{
int bar;
int bar2;
}
Thanks @zealous falcon
@jovial prairie Has your question been resolved? If so, run !solved :)
!solved