Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I want to convert these function in Python to C++. Everybody can help?

Python
def rnd(a):
   h, w = a.shape[:2]
   T = np.zeros((2, 3))
   coef = 0.2
   ang = (np.random.rand()-0.5)*coef
   c, s = np.cos(ang), np.sin(ang)
   T[:2, :2] = [[c,-s], [s, c]]
   T[:2, :2] += (np.random.rand(2, 2) - 0.5)*coef
   c = (w/2, h/2)
   T[:,2] = c - np.dot(T[:2, :2], c)
return T

def div(A, B):
   Ar, Ai = A[...,0], A[...,1]
   Br, Bi = B[...,0], B[...,1]
   C = (Ar+1j*Ai)/(Br+1j*Bi)
   C = np.dstack([np.real(C), np.imag(C)]).copy()
return C


Thank in advance,
Posted

1 solution

Well, if you are waiting for permission, consider it given.

Otherwise...it doesn't quite work like that.
We do not do your work for you.
If you want someone to write your code, you have to pay - I suggest you go to Freelancer.com and ask there.

But be aware: you get what you pay for. Pay peanuts, get monkeys.
 
Share this answer
 
Comments
[no name] 26-Oct-14 11:36am    
*lol* if I would have written such an answer I would be downvoted ;)
my noob 5
OriginalGriff 26-Oct-14 11:42am    
:laugh:
When someone is making no effort at all to do anything for themselves... :sigh:
[no name] 26-Oct-14 11:48am    
:sigh: :-)
Bill Lee Vn 26-Oct-14 21:35pm    
I think i need your help for a simple problem. You are experts, aren't you?
barneyman 26-Oct-14 23:38pm    
how far have you got, and what are you stuck on?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900