Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9173457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:35:34+00:00 2026-06-17T16:35:34+00:00

hi sorry but my maths and physics is too weak so i tried so

  • 0

hi sorry but my maths and physics is too weak so i tried so many times but every time i failed i need your help to complete my app plz convert this circle to heart

import android.graphics.Bitmap;
public class Circle {
float origRadius,deltaRadius,radius,origX,deltaX,x,origY,deltaY,y;
int color,alpha,steps,currentStep;
Bitmap bitmap;

public Circle(float xCenter, float yCenter, float radius,
        int color, int steps) {
    this.x = xCenter;
    this.origX = xCenter;
    this.deltaX = (float) (40.0 * Math.random() - 20.0);

    this.y = yCenter;
    this.origY = yCenter;
    this.deltaY = (float) (40.0 * Math.random() - 20.0);

    this.origRadius = radius;
    this.radius = radius;
    this.deltaRadius = 0.5f * radius;

    this.color = color;
    this.alpha = 0;

    this.steps = steps;
}

void tick() {
    this.currentStep++;

    float fraction = (float) this.currentStep / (float) this.steps;

    this.radius = this.origRadius + fraction * this.deltaRadius;
    this.x = this.origX + fraction * this.deltaX;
    this.y = this.origY + fraction * this.deltaY;

    if (fraction <= 0.25f) {
        this.alpha = (int) (128 * 4.0f * fraction);
    } else {
        this.alpha = (int) (-128 * (fraction - 1) / 0.75f);
    }
}

boolean isDone() {
    return this.currentStep > this.steps;
}
}    

thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T16:35:34+00:00Added an answer on June 17, 2026 at 4:35 pm

    MathWorld had a great heart shaped function; http://mathworld.wolfram.com/HeartCurve.html

    Basically you have to do something like this in your code;

    float fraction = (float) this.currentStep / (float) this.steps;
    

    –>

    float t = this.currentStep * 2.0 * Math.PI / (float) this.steps;
    
    this.x = 16.0 * Math.pow(Math.sin(t), 3.0));
    this.y = 13.0 * Math.cos(t) - 5.0 * Math.cos(2.0 * t) -
              2.0 * Math.cos(3.0 * t) - Math.cos(4.0 * t);
    

    Hope this helps, I’m writing this blindly so bear with me if there’s some mistakes. For radius you might want to do something like this;

    this.x *= radius / 16.0;
    this.y *= radius / 16.0;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry but I am not sure how to ask this question but I am
Sorry but why can't this work: function filter($var) { return($var['id'] < 4); } $t1
I am sorry but I am a complete noob on using maven. There is
First of I'm very sorry but this questions is not so so specific. All
Sorry for question but I can't find answer anywhere on internet. I couldn't find
Sorry for repost but I have a better working example of data that reflects
yes its a joomla question and im sorry to annoy but asking on the
sorry for the dummy question but I cannot find a simple and clean way
Sorry for unclear subject but i really don't understand where problem. I use a
Sorry for newbie question but is there a way to import someone else commit

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.